Skip to content

fix(postgresql): fail PITR WAL inspection errors - #3397

Draft
weicao wants to merge 2 commits into
easton/pg-pitr-restore-commit-time-failfastfrom
easton/pg-pitr-restore-waldump-failfast
Draft

fix(postgresql): fail PITR WAL inspection errors#3397
weicao wants to merge 2 commits into
easton/pg-pitr-restore-commit-time-failfastfrom
easton/pg-pitr-restore-waldump-failfast

Conversation

@weicao

@weicao weicao commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • check pg_waldump before extracting a commit timestamp during PITR restore
  • distinguish a tool failure from a successful WAL containing no transaction records
  • stop before pulling later WALs when an archived segment cannot be inspected

Contract anchors

  • docs/addon-continuous-backup-pitr-chain-integrity-guide.md, pit 4: continuous/PITR chains fail closed rather than silently crossing uncertain segments
  • docs/addon-api/09b-backup-extensions.md: restore must clearly fail when required repository artifacts cannot be validated
  • docs/addon-api/09c-restore-and-rebuild.md: PITR validation includes the actual continuous chain and restored result

TDD evidence

RED commit 294968c5a (Bash 3.2): 12 examples, 1 failure / 3 failed assertions. A simulated pg_waldump rc46 on required WAL002 was treated as an empty-transaction WAL; restore returned success, pulled WAL003, and reported the target reached.

GREEN commit 15b4f7338374d178b51a3344842c4d764ea4de4a:

  • focused PITR restore ShellSpec on Bash 3.2: 12 examples, 0 failures
  • full PostgreSQL ShellSpec on Bash 5.3: 280 examples, 0 failures
  • ShellCheck error severity, Bash syntax, and diff check: clean
  • Helm lint: 1 chart, 0 failures
  • Helm render: 41 documents, 1,013,453 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 19:22
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (f4d6a90) to head (15b4f73).

Files with missing lines Patch % Lines
...ns/postgresql/scripts-ut-spec/pitr_restore_spec.sh 0.00% 9 Missing ⚠️
Additional details and impacted files
@@                             Coverage Diff                             @@
##           easton/pg-pitr-restore-commit-time-failfast   #3397   +/-   ##
===========================================================================
  Coverage                                         0.00%   0.00%           
===========================================================================
  Files                                              195     195           
  Lines                                            28329   28338    +9     
===========================================================================
- Misses                                           28329   28338    +9     

☔ 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