vfs/disk: Fix EvictDiskVisibilityAndRecreateSafety flake #19
Reference in New Issue
Block a user
Delete Branch "fix/disk-evict-stat-race"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Make
insertBatchfail-closed: re-stat under lock and skip gone files so bg population cannot resurrect keys after Evict/Delete. Tighten EvictDiskVisibility test (drain init via Size) and add InsertBatchSkipsGoneFiles. Optional: paths-ignore markdown on push to main.Why
CI #1145 failed under
-race -shuffle=on: Stat succeeded while the backing file was already gone. Create does not wait on initDone; the bg scan can discover files that eviction later removes, then insertBatch re-indexed the stale discovery.Test
go test -race -count=20 -shuffle=on ./vfs/diskgreen locallyFixes #18