mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 10:07:28 +01:00
A file created on a mount is published to the filer at flush; until then its handle is dirty and has no base. When another mount creates the same name and its event arrives first, invalidateOpenFileHandle skips the branch that keeps a dirty handle's writes, because that branch needs a base. It falls through, destroys the handle's dirty pages and installs the other mount's entry as the base. The flush then has nothing to publish, and close() returns 0 although the writes are gone. A delete or rename of the name by another mount marks the handle deleted or moves it, with the same result, and a rename onto the name has onEntryInvalidation mark it deleted. The filer holds nothing of such a file, so an event at its name is about another file. Leave the handle alone. Its create-if-not-exists commit then reports a taken name as a conflict (close() fails with EIO, or with -writebackCache the request is kept in failed-metadata), and publishes as usual when the name is free. Part of #12941.