Commit 6cfd59b
BuildCache::store wrote a keys/<chain-key> JSON record on every cacheable step
and called prune_to, but prune_to evicted ONLY blobs/ — the keys/ directory was
never cleaned. The chain key folds COPY/ADD content hashes, so edit-and-rebuild
yields a fresh key per content change; over a long-lived build host these small
records accumulate without bound, and after blob eviction they become permanent
dangling pointers (lookup correctly misses but never removes them). 'system
prune' has no buildcache references either.
After evicting blobs, prune_to now sweeps keys/ and removes any record whose
referenced blobs/<digest> no longer exists (also drops unparseable/truncated key
records). Test prune_evicts_orphan_key_records.
Co-authored-by: Roy Lin <roylin@a3s.box>
1 parent 6ebb5b7 commit 6cfd59b
1 file changed
Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
203 | 229 | | |
204 | 230 | | |
205 | 231 | | |
| |||
332 | 358 | | |
333 | 359 | | |
334 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
335 | 388 | | |
336 | 389 | | |
337 | 390 | | |
| |||
0 commit comments