mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
249afe303aa2fa02a4c6a093dc2df6765143ee75
The removal no longer rests on a lease check before an unconditional delete, which a delete landing after the lease and a successor's commit defeated. Every object entry carries the session of its last writer and a mark. RemoveUnreachable plans after BeginClean, then for each unreachable candidate MARKs it (conditional on the metadata read for the plan, unmarked) and DELETEs it (conditional on that mark). Writing an object for a session (EnsureObject) creates it, or reuses an existing one by a conditional update that sets the session and clears any mark, so a reuse after the plan or after the mark makes the remover's write fail its own condition, however late it lands. A commit names only objects its own session wrote or reused, unmarked. The source guard now requires DeleteMarked as the remover's only removal, each immediately after a gate on its mark's error. Tests cover both reuse windows (after the plan, after the mark), another session's mark, the commit's session rule and the cleaning killed at each of its six writes. 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%