Eviction no longer reads a whole table while requests wait on the database (closes #227) #228

Merged
clawbot merged 1 commits from issue-227-size-total into next 2026-10-08 07:12:03 +02:00
1 Commits
Author SHA1 Message Date
clawbot 160335724e Eviction no longer reads a whole table while requests wait on the database (closes #227)
check / check (push) Waiting to run
UsageBytes now reads the new cache_usage row, which triggers on
source_content and variant_content keep up to date in the statement
that adds, removes or resizes a row. The reconciliation pass reads both
tables 1000 rows per query, sums them, and corrects the total when it
differs, unless a row changed while it summed. Source rows now get
last_accessed_at when added, so choosing source images to evict reads
that column's index instead of sorting the whole table. Stats still
sums the tables, now in pages: an existing test drops both tables and
expects that sum to fail.

Model: opus-5-5
2026-10-08 04:29:07 +00:00