mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
b91b2bf3b36f1c2f753a74b26a535df3759e1fbf
The chunk's highest write LSN is not a change detector: a replica apply may land a block at an LSN below another block of the same chunk, so the maximum does not move and a stale stage could be reused. Each chunk now has a mutation count, raised after every dirty-map insert (a write, a batch write, a replica apply at any LSN) and every BASE block; flushing moves bytes without changing them and never counts. It is an atomic per-chunk counter on the write path (O(1), lock-free), sampled before the staging read and compared at the barrier. A barrier Sync failure after staging is a clean abort: the cut's staging intents are deleted (a failed delete is kept and retried by the next cut). Real-caller controls: - chunk 0 holds a@10 and b@5; after the staging read, ApplyEntry(b, 6) through the production apply path, in the WAL and flushed: HEAD at H has b@6; - staged uploads, then the local fsync fails at the barrier: no intent is left; with the intent delete failing too, the intent is kept and the next cut settles it and publishes the exact image. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Languages
Go
84.5%
Rust
7.9%
Shell
2.7%
templ
1.6%
Java
1%
Other
2%