Skip to content

fix(postgresql): fail invalid WAL commit times - #3396

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

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

Conversation

@weicao

@weicao weicao commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • reject transaction commit timestamps that date -d cannot parse during PITR WAL inspection
  • emit the affected WAL name and return before comparing an indeterminate epoch or pulling later WALs
  • add focused ShellSpec coverage for this archive-chain boundary

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 626efc6b2 (Bash 3.2): 11 examples, 1 failure / 3 failed assertions. A simulated parser failure for required WAL002's commit timestamp returned success, emitted no diagnostic, and continued to pull WAL003.

GREEN commit f4d6a90e8bfa93373fd733a682bfa2af8cccdad8:

  • focused PITR restore ShellSpec on Bash 3.2: 11 examples, 0 failures
  • full PostgreSQL ShellSpec on Bash 5.3: 279 examples, 0 failures
  • ShellCheck error severity, Bash syntax, and diff check: clean
  • Helm lint: 1 chart, 0 failures
  • Helm render: 41 documents, 1,013,258 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:44
@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 (d2486d3) to head (f4d6a90).

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-target-time-failfast   #3396   +/-   ##
===========================================================================
  Coverage                                         0.00%   0.00%           
===========================================================================
  Files                                              195     195           
  Lines                                            28320   28329    +9     
===========================================================================
- Misses                                           28320   28329    +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