Skip to content

fix(postgresql): filter PITR start WAL files - #3399

Draft
weicao wants to merge 2 commits into
easton/pg-pitr-restore-destination-failfastfrom
easton/pg-pitr-restore-start-wal-filter
Draft

fix(postgresql): filter PITR start WAL files#3399
weicao wants to merge 2 commits into
easton/pg-pitr-restore-destination-failfastfrom
easton/pg-pitr-restore-start-wal-filter

Conversation

@weicao

@weicao weicao commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • select the PITR restore start boundary only from exact 24-hex PostgreSQL WAL segment files
  • ignore unrelated regular files and incomplete/non-segment artifacts in pg_wal
  • fail clearly when no valid local starting segment exists

Contract anchors

  • docs/addon-continuous-backup-pitr-chain-integrity-guide.md, pit 4: continuous/PITR chains must not silently skip required segments
  • docs/addon-api/09b-backup-extensions.md: restore inputs and artifact traversal must be validated before destructive handoff
  • docs/addon-api/09c-restore-and-rebuild.md: PITR validation includes prepareData, continuous-chain selection, and the restored result

TDD evidence

RED commit 777265713 (Bash 3.2): 14 examples, 1 failure / 2 failed assertions. With valid local WAL001 plus unrelated README, prepareData selected README, skipped repository WAL002, returned success, and staged the restore.

GREEN commit cb7ad581c4f2884304dc121abbea37fc2cbef23b:

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

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.00%. Comparing base (1fbbc0b) to head (cb7ad58).

Files with missing lines Patch % Lines
...ns/postgresql/scripts-ut-spec/pitr_restore_spec.sh 0.00% 14 Missing ⚠️
Additional details and impacted files
@@                             Coverage Diff                             @@
##           easton/pg-pitr-restore-destination-failfast   #3399   +/-   ##
===========================================================================
  Coverage                                         0.00%   0.00%           
===========================================================================
  Files                                              195     195           
  Lines                                            28346   28360   +14     
===========================================================================
- Misses                                           28346   28360   +14     

☔ 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