mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
451fa936a735230bf939136b7f4b730bb71eb03c
Design review of the copy-before-write proposal, folded in one revision: - the COW step runs before publication and outside store.mu (right after captureMu shared, before lifecycleMu/mu, the WAL append and the dirty-map insert), because the save uses the ordinary read path; a post-publication hook cannot do this; lock order stated; - one owner per chunk (copier: pending -> copying -> done; writer: pending -> saving -> saved), a per-chunk mutex never held across I/O, waiters on a per-chunk condition; - batches visit chunks in ascending index and finish each before the next, so they cannot deadlock with each other or the copier; - terminal states closed or aborted; abort on save error, cancel, fence, and before Recover/reset/Close in the same open, taken before the mutation proceeds; waiters woken; the cut fails retryable and keeps its dirty set; a guest write is never refused for a cut problem; - the side store is deleted only after close/abort with its refcount at zero; upload, manifest and CAS work from the buffers, so an unknown CAS keeps today's semantics; - BASE: capMu stays held for the whole cut and already excludes Begin/EndBaseInstall (the earlier open point is removed); - reads bind to the format-v3 read path, no flusher hook; - the Model paragraph states what the model does not cover (owner races, batch order, abort), and the test list grows to match. Text only; the TLA+ model is unchanged. 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%