Audit retention writes a record when it prunes nothing #1810

Closed
opened 2026-11-08 06:15:13 +00:00 by sam · 1 comment
Owner

What is wrong

The audit-retention sweep writes a sys_audit row on every State Store start even when it pruned nothing ({"rows": 0, "cutoff": ...}). 210 of the 625 audit rows on the production instance (a third of the table) are these no-op records, and they appear in the audit feed.

Done when

  • A retention sweep that prunes zero rows writes no audit row.
  • Verified by a test that a sweep over an empty range adds no row and one that prunes adds one.
## What is wrong The audit-retention sweep writes a `sys_audit` row on every State Store start even when it pruned nothing (`{"rows": 0, "cutoff": ...}`). 210 of the 625 audit rows on the production instance (a third of the table) are these no-op records, and they appear in the audit feed. ## Done when - A retention sweep that prunes zero rows writes no audit row. - Verified by a test that a sweep over an empty range adds no row and one that prunes adds one.
Author
Owner

Fixed in 5939ef6f: the retention sweep writes its audit row only when it pruned rows. No test: it needs a real database, which the repo forbids.

Fixed in 5939ef6f: the retention sweep writes its audit row only when it pruned rows. No test: it needs a real database, which the repo forbids.
sam closed this issue 2026-11-08 06:28:43 +00:00
sam added the bug label 2026-11-12 15:52:54 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1810