Skip to content

fix: add blob retention floor to GC and replace dead --cache-ttl flag#40

Merged
wolfeidau merged 2 commits into
mainfrom
fix_gc_floor
Feb 25, 2026
Merged

fix: add blob retention floor to GC and replace dead --cache-ttl flag#40
wolfeidau merged 2 commits into
mainfrom
fix_gc_floor

Conversation

@wolfeidau
Copy link
Copy Markdown
Member

GC phase 2 previously deleted all blobs with RefCount == 0 on every hourly run, regardless of how recently they were downloaded. This caused ~233 blobs (1.26 GB) to be swept in a single run shortly after jobs completed, since envelope expiry drops RefCount to zero and GC fires within the hour.

  • Add BlobRetentionTTL to gc.Config: blobs are only deleted when max(CachedAt, LastAccess) + retention < now, giving a sliding window analogous to S3-FIFO's second-chance mechanism
  • Add before time.Time parameter to GetUnreferencedBlobs (zero = no floor, preserving existing behaviour)
  • Replace unwired --cache-ttl flag (default 168h, connected to nothing) with --blob-retention (default 24h, wired to GC)
  • Suppress /metrics and /healthz request logs to reduce scraper noise
  • Switch dev log format to JSON and tee to dev/data/logs/content-cache.log

GC phase 2 previously deleted all blobs with RefCount == 0 on every hourly run, regardless of how recently they were downloaded. This caused ~233 blobs (1.26 GB) to be swept in a single run shortly after jobs completed, since envelope expiry drops RefCount to zero and GC fires within the hour.

* Add BlobRetentionTTL to gc.Config: blobs are only deleted when max(CachedAt, LastAccess) + retention < now, giving a sliding window analogous to S3-FIFO's second-chance mechanism
* Add before time.Time parameter to GetUnreferencedBlobs (zero = no floor, preserving existing behaviour)
* Replace unwired --cache-ttl flag (default 168h, connected to nothing) with --blob-retention (default 24h, wired to GC)
* Suppress /metrics and /healthz request logs to reduce scraper noise
* Switch dev log format to JSON and tee to dev/data/logs/content-cache.log
@wolfeidau wolfeidau merged commit 0b7c990 into main Feb 25, 2026
1 check passed
@wolfeidau wolfeidau deleted the fix_gc_floor branch February 25, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant