fix(chopper): expire unused attic objects after 90 days - #114
Open
devusb wants to merge 1 commit into
Open
Conversation
The collector ran every 14 days but default-retention-period was unset, which defaults to zero and disables time-based collection, so the cache grew without bound. Objects are now eligible once both created_at and last_accessed_at are older than 90 days. Claude-Session: https://claude.ai/code/session_01TMTHV4JBQMmtSLPoRkbZie
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
garbage-collection.intervalwas set to 14 days, butdefault-retention-periodwas never set. It defaults toDuration::ZERO, which disables time-based collection entirely — so the collector has been waking up every two weeks and deleting nothing, and the cache has been retaining everything since it was stood up.This sets a 90 day default retention. Objects become eligible only when both
created_atandlast_accessed_atare older than the cutoff, so anything actively pulled keeps resetting its own clock.Note for caches that must never expire
Attic excludes any cache whose effective retention is
0from time-based GC (the GC query filters onretention_period.ne(0), falling back to the global default when the per-cache value is NULL). To pin one:Watch out when reconfiguring such a cache later —
attic cache configureresetsretention_periodto the global default whenever--retention-periodis not passed, so pass it on everyconfigurecall for that cache.Verification
nix eval .#nixosConfigurations.chopper.config.containers.attic.config.services.atticd.settings.garbage-collection→{"default-retention-period":"90 days","interval":"14 days"}nix fmtreports 0 changed filesNot yet deployed — this only changes the config.
https://claude.ai/code/session_01TMTHV4JBQMmtSLPoRkbZie