Files
pulse/pkg/metrics
pulse-triage[bot] e1d97b361e fix(metrics): harden store rollups, retries and auto-vacuum
Address the remaining verified findings from the pkg/metrics/store.go review
(#2079 findings 2-4 and 6):

- rollupTier no longer leaps its checkpoint over a source gap. Previously a
  trailing or interspersed gap advanced the checkpoint to the rollup cutoff, so
  a lower tier that backfilled the gap later had those rows stranded below the
  upper checkpoint and purged by retention.
- Retry conditions now classify SQLITE_BUSY/LOCKED by driver result code. The
  modernc driver reports "database is locked (5) (SQLITE_BUSY)", which the
  previous exact-string comparison never matched, so a busy writer dropped its
  batch without retrying.
- The metrics upsert preserves an existing rollup row's min/max spread with
  COALESCE instead of overwriting it with NULL.
- migrateAutoVacuum pins the pragma and VACUUM to one connection and verifies
  the persisted mode, so the one-time conversion cannot silently repeat a
  full-file VACUUM on every restart.

Regressions: TestStoreRollupTierBackfillsInterspersedGap,
TestStoreWriteBatchPreservesRollupSpread, TestIsRetryableWriteError,
TestIsRetryableWriteErrorMatchesDriverBusyCode,
TestStoreAutoVacuumPersistsAcrossRestart. The performance-and-scalability
contract records the invariants.

Change-source: pulse-maintainer
2026-09-19 19:19:13 +01:00
..
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00
2026-03-18 16:06:30 +00:00