mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-10-24 04:33:17 +00:00
e1d97b361e
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