Skip to content

fix(postgresql): parse PITR retention TTL as decimal - #3391

Draft
weicao wants to merge 2 commits into
easton/pg-pitr-retention-ttl-validationfrom
easton/pg-pitr-retention-ttl-base10
Draft

fix(postgresql): parse PITR retention TTL as decimal#3391
weicao wants to merge 2 commits into
easton/pg-pitr-retention-ttl-validationfrom
easton/pg-pitr-retention-ttl-base10

Conversation

@weicao

@weicao weicao commented Aug 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • parse the already validated DP_TTL_SECONDS value explicitly as base 10 during PITR expiry cutoff arithmetic
  • cover leading-zero decimal TTLs so Bash cannot silently reinterpret them as octal

Candidate

Contract

  • kubeblocks-addon-docs/docs/addon-continuous-backup-pitr-chain-integrity-guide.md, pit 3: retention cleanup must keep the advertised recovery window aligned with repository artifacts
  • kubeblocks-addon-docs/docs/addon-api/09b-backup-extensions.md: Continuous/PITR time ranges and repository retention must remain explainable and testable

TDD evidence

RED commit 1d5f0a29e:

  • DP_TTL_SECONDS=03600
  • expected decimal cutoff: 10000 - 3600 = 6400
  • observed before fix: cutoff 8080, because Bash parsed 03600 as octal 1920
  • focused result: 1 example, 1 failure

GREEN exact head cd5ef60fc:

  • focused Bash 3.2: 60 examples, 0 failures
  • full PostgreSQL Bash 5.3: 273 examples, 0 failures
  • ShellCheck severity error: clean
  • Bash syntax and git diff --check: clean
  • Helm lint: 1 chart, 0 failures
  • Helm render: 41 documents, 1,012,454 bytes

Runtime boundary

This is source-level arithmetic and ShellSpec validation only. Runtime packaging, environment execution, cleanup, and formal acceptance counts remain Test-owned and are not claimed by this PR.

@weicao
weicao requested review from a team, ldming and leon-ape as code owners August 16, 2026 15:52
@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 (500684b) to head (cd5ef60).

Files with missing lines Patch % Lines
...ons/postgresql/scripts-ut-spec/pitr_backup_spec.sh 0.00% 7 Missing ⚠️
Additional details and impacted files
@@                           Coverage Diff                           @@
##           easton/pg-pitr-retention-ttl-validation   #3391   +/-   ##
=======================================================================
  Coverage                                     0.00%   0.00%           
=======================================================================
  Files                                          195     195           
  Lines                                        28267   28274    +7     
=======================================================================
- Misses                                       28267   28274    +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.

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