You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cache: eviction deletes the disk copy of a victim flushed after selection #71
Found by a memory-accounting audit of 8b3c813. The tests are on branch audit/memory-tests and fail on main today; check out that branch to run them. File and line links point at that commit.
What goes wrong.
evict_victim_inner reads the victim's slot when it runs (core.rs:845-850), not when the victim was chosen.
If the victim was flushed to disk after find_memory_victim returned it but before the eviction ran, the slot now holds a disk record. The eviction policy answers Remove for disk records (src/core/src/cache/policies/eviction.rs:76), and remove_disk_entry deletes the object that the flush just wrote (core.rs:886-888).
The cached data is lost. It is re-read from parquet, so this is not user data loss.
Evidence. Victims 9810 and 9811 were flushed between selection and eviction. Afterwards both were unreadable, the store held 0 objects, and the index held 1 entry. The flush is injected by a test-only cache policy hook.
cargo +1.96.0 test -p liquid-cache --lib audit_a_memory_victim_flushed_before_its_eviction_keeps_its_disk_record -- --nocapture
F (test policy HookAfterMemoryVictims)
Flags: P probabilistic (a pass after a fix only means the race wasn't hit), F interleaving forced by a test hook, L Linux only, D needs Docker, M measurement only, C control (passes by design).
Activity