Files
seaweedfs/weed/server
MapleWhiteZZZandClaude Fable 5.2 156a0078c4 filer: run an entry update again when a rename or delete of it commits meanwhile
UpdateEntry reads the entry, checks its preconditions against it, then
writes. The path lock keeps the two together only against writers of that
path on that filer. A rename or a delete sent to another filer does not
take it, and on any filer a rename or recursive delete of a directory above
the entry moves and removes what is below it unlocked. One that committed
between the read and the write had the write store the entry again at the
path it had left, and the update returned success: the entry back under a
directory that is gone, two names sharing chunks, or a file back after its
unlink returned.

Where the store refuses a conflicting commit, the read, the checks and the
write now run in one store transaction. The rename or delete wrote the
entry's key after it began, so the commit is refused with
ErrTransactionConflict and the update runs again, up to five times with
the rename's back-off, and answers from what is there now.

- filer.ConflictRefusingStore is how a store says so. TiKV does. Other
  stores, and entries in a path-specific store, run once without a
  transaction, as before.
- A refused run gives up its commit stamp and deletes the manifest chunks
  it folded the request's chunks into.
- Chunk deletion and the metadata event come after the commit, in the
  order they had.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 14:42:06 +00:00
..
2026-02-20 18:42:00 -08:00