Skip to content

fix(postgresql): stop failed PITR WAL pulls - #3394

Draft
weicao wants to merge 2 commits into
easton/pg-pitr-restore-list-orderfrom
easton/pg-pitr-restore-pull-failfast
Draft

fix(postgresql): stop failed PITR WAL pulls#3394
weicao wants to merge 2 commits into
easton/pg-pitr-restore-list-orderfrom
easton/pg-pitr-restore-pull-failfast

Conversation

@weicao

@weicao weicao commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • fail PITR restore immediately when datasafed pull cannot retrieve a required archived WAL
  • stop before inspecting the missing destination or pulling later WALs across the resulting archive gap
  • add focused ShellSpec coverage for the first-failure boundary

Contract anchors

  • docs/addon-continuous-backup-pitr-chain-integrity-guide.md, pit 4: archive chains fail closed at missing segments
  • docs/addon-api/09b-backup-extensions.md: restore must fail clearly when required repository artifacts are unavailable
  • docs/addon-api/09c-restore-and-rebuild.md: PITR acceptance requires the continuous chain and post-restore result, not only a restore timestamp

TDD evidence

RED commit 87c2e128b (Bash 3.2): 9 examples, 1 failure / 3 failed assertions. A simulated rc44 pulling required WAL002 returned success, emitted no pull diagnostic, and continued to pull WAL003.

GREEN commit 7fe7358b05a2cc7d3e11300e089f06407cbeeee8:

  • focused PITR restore ShellSpec on Bash 3.2: 9 examples, 0 failures
  • full PostgreSQL ShellSpec on Bash 5.3: 277 examples, 0 failures
  • ShellCheck error severity, Bash syntax, and diff check: clean
  • Helm lint: 1 chart, 0 failures
  • Helm render: 41 documents, 1,012,973 bytes

Scope

Source/static product change only. Runtime package, environment, execution, cleanup, and formal repeated-full acceptance remain tester-owned and are not claimed here.

@weicao
weicao requested review from a team, ldming and leon-ape as code owners August 16, 2026 17:34
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (4dc19e2) to head (7fe7358).

Files with missing lines Patch % Lines
...ns/postgresql/scripts-ut-spec/pitr_restore_spec.sh 0.00% 10 Missing ⚠️
Additional details and impacted files
@@                        Coverage Diff                        @@
##           easton/pg-pitr-restore-list-order   #3394   +/-   ##
=================================================================
  Coverage                               0.00%   0.00%           
=================================================================
  Files                                    195     195           
  Lines                                  28303   28313   +10     
=================================================================
- Misses                                 28303   28313   +10     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@weicao
weicao marked this pull request as draft August 17, 2026 03:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants