litestream icon indicating copy to clipboard operation
litestream copied to clipboard

fix(store): retry compaction when db not ready instead of waiting full interval

Open corylanou opened this issue 4 weeks ago • 0 comments

Summary

Follow-up to #886. When a database returns ErrDBNotReady, the compaction monitor now retries after 1 second instead of waiting for the full compaction interval (which could be 24 hours for snapshots).

Changes

  • Track when any DB returns ErrDBNotReady during compaction iteration
  • Use short retry interval (1s) if retry needed, up to 30s timeout
  • Log warning if timeout exceeded (DB never initialized)
  • Reset retry counter and use normal interval after success

Behavior

Before: If DB not ready at startup, wait full interval (L9: 24h, L1: 30s, etc.)

After: Retry every 1 second until DB is ready (max 30s timeout), then use normal interval

Test plan

  • [x] All existing tests pass (go test ./...)
  • [x] Pre-commit hooks pass

Related to #877

🤖 Generated with Claude Code

corylanou avatar Dec 11 '25 16:12 corylanou