Skip to content

fix: reject overflowing backup and PostgreSQL durations - #215

Merged
vishr merged 2 commits into
mainfrom
fix/duration-overflow
Oct 5, 2026
Merged

vishr merged 2 commits into
mainfrom
fix/duration-overflow

Conversation

@vishr

@vishr vishr commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

What this changes

Reject duration overflow before multiplying whole-day backup windows or PostgreSQL settings into nanoseconds. Previously 213504d became a plausible 25-minute window; oversized PostgreSQL values also wrapped in every supported unit. Backup health checks now report invalid or overflowing server timeouts and effective policies, and disabled archive timeouts, instead of silently treating them as within policy.

Addresses item 1 of #111. The other timing, documentation, and rollout follow-ups in that umbrella remain open.

Why this is correct

Regression tests failed on the original code and now cover the largest representable count and the first overflowing count for every PostgreSQL unit, positive day windows, and backup-policy validation for data loss, retention, and drill age. Engine-level tests cover invalid/overflowing timeout diagnostics, disabled archiving, invalid retained policies, and valid timeout boundaries. Existing parser syntax and zero-valued PostgreSQL settings remain supported. Independent local agent review found no remaining issues.

Validation: targeted regression tests and just ci pass locally, including all Go tests, vet, lint, vulnerability/workflow checks, generated documentation verification, and the website build. All five GitHub CI checks pass on the updated head, including Docker E2E and native Linux/macOS/Windows smoke tests. Copilot's fresh Lite review reports no findings and confirms the earlier production-caller finding is resolved. Docker/remote-host E2E was not run locally.

Effect on the safety envelope

Oversized durations are refused rather than allowed to wrap into misleadingly short values. No new capability or host operation is introduced.

Checklist

  • just check passes locally.
  • Tests cover the new behaviour, including the failure paths.
  • Generated documentation is current (just check verifies this).
  • CLA acceptance is managed by the contributor and repository bot.

@vishr
vishr requested a balanced review from Copilot October 5, 2026 04:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The overflow checks are correct, comprehensive, and covered by focused regression tests.

Review effort: Balanced
Findings: None

What changed in this PR

Prevents duration overflow from producing misleadingly short backup and PostgreSQL durations.

Changes:

  • Adds overflow checks before duration multiplication.
  • Rejects oversized positive-day backup windows.
  • Adds boundary and backup-policy regression tests.
File Description
internal/​app/​runtime.go Safely parses PostgreSQL duration units.
internal/​app/​backup_schema.go Caps whole-day positive durations.
internal/​app/​duration_limits_test.go Tests valid boundaries and overflow rejection.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@vishr
vishr requested a balanced review from Copilot October 5, 2026 05:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

PostgreSQL overflow returns a parse failure that the production safety check silently ignores.

Review effort: Balanced
Findings: 1 High severity

Open (1)

Comment thread internal/app/runtime.go

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

Resolved since last review (1)

@vishr
vishr merged commit 4991e41 into main Oct 5, 2026
6 checks passed
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