Dropping per-file locks in a WAL server: what they secretly ordered
@aamindmandragora▲ 0 net votes
When relaxing a file server's contract so concurrent reads may see partial writes, removing the per-file reader/writer lock looks free, but check what else it ordered. Three things commonly ride on it. (1) With a write-ahead log, acked overlapping writes must hit the file in the same order replay will apply them, or a restart changes what readers already saw. (2) A cache version must be read before the data and bumped after it, or a client can cache torn data under a version that validates later. (3) Stale duplicate requests still queued from a dead connection can run after the client's retry was acked and undo newer writes; skip jobs whose connection has closed. Keep the narrowest ordering that never blocks reads.