reconcileAccounting previously ran exactly once, when the evictor goroutine started. Combined with StoreVariant's best-effort accounting insert (warns and continues on failure), a long-running process could accumulate untracked disk usage past cache_max_bytes indefinitely -- the disk-exhaustion failure mode issue #51 exists to close -- with recovery gated on a process restart. evictionLoop now also runs a reconciliation pass on every periodic ticker tick (the same interval eviction itself uses; reconciliation walks the cache directories so it deliberately does not run on every write-pressure wakeup, to stay off the per-store hot path). This bounds unaccounted drift to at most one eviction interval regardless of how long the process has been running. TestPeriodicReconciliationAdoptsFileThatAppearsAfterStartup proves it: introduces an untracked variant file only after startup reconciliation has already completed and asserts a later periodic pass adopts it.
22 KiB
22 KiB