Skip to content

fix(postgresql): fail PITR destination setup - #3398

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

fix(postgresql): fail PITR destination setup#3398
weicao wants to merge 2 commits into
easton/pg-pitr-restore-waldump-failfastfrom
easton/pg-pitr-restore-destination-failfast

Conversation

@weicao

@weicao weicao commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • check PITR WAL destination directory creation before repository access
  • emit the failed destination path and return instead of continuing after mkdir -p fails
  • add focused ShellSpec coverage for the setup boundary

Contract anchors

  • docs/addon-continuous-backup-pitr-chain-integrity-guide.md, pit 4: continuous/PITR chains fail closed rather than silently proceeding through missing state
  • docs/addon-api/09b-backup-extensions.md: restore must clearly fail when required inputs or artifact handling cannot be initialized
  • docs/addon-api/09c-restore-and-rebuild.md: PITR validation includes prepareData and the actual restored result

TDD evidence

RED commit e3832306d (Bash 3.2): 13 examples, 1 failure / 3 failed assertions. When the destination parent was a file, mkdir -p failed but restore returned success, emitted no setup diagnostic, and still listed the WAL repository.

GREEN commit 1fbbc0b62463d3e12a44f81abcfca7f4337e9686:

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

Copy link
Copy Markdown

Codecov Report

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

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

☔ 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