Skip to content

fix(postgresql): fail invalid PITR restore times - #3395

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

fix(postgresql): fail invalid PITR restore times#3395
weicao wants to merge 2 commits into
easton/pg-pitr-restore-pull-failfastfrom
easton/pg-pitr-restore-target-time-failfast

Conversation

@weicao

@weicao weicao commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reject restore target times that date -d cannot parse
  • emit a phase-specific diagnostic and return before destination setup or WAL repository access
  • add focused ShellSpec coverage for the fail-fast boundary

Contract anchors

  • docs/addon-continuous-backup-pitr-chain-integrity-guide.md, pit 4: continuous/PITR chains fail closed rather than silently crossing gaps
  • docs/addon-api/09b-backup-extensions.md: restore must clearly fail when required inputs or repository artifacts are invalid
  • docs/addon-api/09c-restore-and-rebuild.md: PITR validation includes restore-time parameter propagation and the actual continuous chain

TDD evidence

RED commit 481ba4e3b (Bash 3.2): 10 examples, 1 failure / 3 failed assertions. A simulated rc45 parsing invalid-target returned success, emitted no target-time diagnostic, and still listed the WAL repository.

GREEN commit d2486d384e0d626226bcd664b333d30401a87b56:

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

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
...ns/postgresql/scripts-ut-spec/pitr_restore_spec.sh 0.00% 7 Missing ⚠️
Additional details and impacted files
@@                         Coverage Diff                          @@
##           easton/pg-pitr-restore-pull-failfast   #3395   +/-   ##
====================================================================
  Coverage                                  0.00%   0.00%           
====================================================================
  Files                                       195     195           
  Lines                                     28313   28320    +7     
====================================================================
- Misses                                    28313   28320    +7     

☔ 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