Skip to content

fix(postgresql): fail invalid PITR recovery times - #3400

Draft
weicao wants to merge 2 commits into
easton/pg-pitr-restore-start-wal-filterfrom
easton/pg-pitr-restore-recovery-time-failfast
Draft

fix(postgresql): fail invalid PITR recovery times#3400
weicao wants to merge 2 commits into
easton/pg-pitr-restore-start-wal-filterfrom
easton/pg-pitr-restore-recovery-time-failfast

Conversation

@weicao

@weicao weicao commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

What

Validate and format the PostgreSQL PITR recovery timestamp before repository access or restore handoff mutation.

Why

The command substitution inside the recovery.conf heredoc masked date failures. An invalid timestamp could therefore return success, access the WAL repository, write an empty recovery target, and move DATA_DIR to .old.

Tests

  • RED (76e2030e5): Bash 3.2 focused ShellSpec, 15 examples / 1 failure / 5 failed assertions
  • GREEN: Bash 3.2 focused ShellSpec, 15 examples / 0 failures
  • GREEN: Bash 5.3 full PostgreSQL ShellSpec, 283 examples / 0 failures
  • ShellCheck error severity, Bash syntax, and git diff --check
  • helm lint addons/postgresql: 1 chart / 0 failures
  • helm template: 41 documents / 1,014,156 bytes

@weicao
weicao requested review from a team, ldming and leon-ape as code owners August 16, 2026 21:20
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

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

Files with missing lines Patch % Lines
...ns/postgresql/scripts-ut-spec/pitr_restore_spec.sh 0.00% 12 Missing ⚠️
Additional details and impacted files
@@                           Coverage Diff                           @@
##           easton/pg-pitr-restore-start-wal-filter   #3400   +/-   ##
=======================================================================
  Coverage                                     0.00%   0.00%           
=======================================================================
  Files                                          195     195           
  Lines                                        28360   28372   +12     
=======================================================================
- Misses                                       28360   28372   +12     

☔ 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