Garbage collector for the global content-addressable store.
Conservative candidate → quarantine → delete pipeline (PRD §14):
- Build the reachable-hash set from GC roots:
obj:*/obj_ver:*object metadata (content_hash) and active multipart part records (mpu_part:*hash). - Restore any quarantined blob whose hash became reachable again.
- Unreachable active blob files older than the mtime grace become
gc:candidate:{hash}records. - Candidates past
eligible_afterand still unreachable move tocas/gc/quarantine/sha256-{hash}(blob metadata →:quarantined). - Quarantined entries past their second
eligible_afterand still unreachable are deleted: file, blob metadata, candidate record.
Reachability is re-checked at every stage, so a blob that regains a
reference at any point is never deleted. The legacy ContentGC owns
the legacy bucket-local tree; this module only touches cas/objects
and cas/gc/quarantine. Loose fallbacks retained for packed blobs are
owned by Packer cleanup and are never GC candidates.
Configuration (app env, overridable per run_now/1 call):
:cas_gc_interval— sweep interval ms (default 30 min):cas_gc_orphan_mtime_grace— seconds a file must be unmodified before it can become a candidate (default 600):cas_gc_candidate_grace— seconds before a candidate may be quarantined (default 3600):cas_gc_quarantine_grace— seconds before a quarantined blob may be deleted (default 86_400)
Summary
Functions
Returns a specification to start this module under a supervisor.
Report what a sweep would do without modifying files or metadata.
Run one sweep now. Options: :orphan_mtime_grace, :candidate_grace, :quarantine_grace, :dry_run.
Counts of current candidate and quarantined records.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Report what a sweep would do without modifying files or metadata.
Run one sweep now. Options: :orphan_mtime_grace, :candidate_grace, :quarantine_grace, :dry_run.
Counts of current candidate and quarantined records.