Skip to content

fix(config): reject snapshot retention shorter than interval - #1471

Open
UniversePeak wants to merge 1 commit into
benbjohnson:mainfrom
UniversePeak:fix/validate-snapshot-retention
Open

fix(config): reject snapshot retention shorter than interval#1471
UniversePeak wants to merge 1 commit into
benbjohnson:mainfrom
UniversePeak:fix/validate-snapshot-retention

Conversation

@UniversePeak

Copy link
Copy Markdown

Summary

Reject configurations where snapshot retention is shorter than the snapshot interval.

Problem

A configuration with snapshot.interval greater than snapshot.retention currently starts successfully even though retention cannot preserve a full snapshot interval. This makes the retention setting ineffective and provides no startup signal.

Solution

Validate the relationship for both global and per-database snapshot settings, returning a dedicated configuration validation error.

Scope

In scope:

  • Global snapshot.retention versus snapshot.interval validation
  • Per-database snapshot relationship validation
  • Focused parser regression tests

Not in scope:

  • Runtime retention behavior
  • Changes to existing positive-duration validation

Test Plan

  • go test ./cmd/litestream -run 'TestConfig' -count=1
  • go vet ./cmd/litestream

Both commands pass locally. The full package suite has unrelated Windows-path and file-locking failures in this checkout.

Related

@UniversePeak

Copy link
Copy Markdown
Author

This PR has been open for over a week with all reported checks passing, including the focused config tests, lint, and cross-platform build checks. I’m following up on the review status when you have a chance. The change is limited to validating global and per-database snapshot retention against their intervals, with no runtime retention behavior changes.

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.

Nothing complains if I set retention interval lower than snapshot interval

1 participant