mirror of
https://github.com/rustfs/rustfs.git
synced 2026-10-27 06:18:43 +00:00
276cb24e26
* fix(ecstore): share metadata cache identity across Windows key aliases Windows disks treat `\` as a path separator and `path_join_buf` drops the empty segments that leaves, so `a\b`, `a\\b`, `\a\b` and `a\b\` all address the xl.meta of `a/b`. The GetObject metadata cache keyed and hashed the raw spelling, so DELETE `a\b` retired nothing cached for `a/b`: GET/HEAD `a/b` kept returning the deleted object for up to the 2s cache TTL. Fold the object name into the same segment form the disk resolves to before computing the cache hash, key and lookup key. Off Windows the name stays verbatim and borrowed, so `\` remains an ordinary key byte. * fix(ecstore): serialize Windows backslash key aliases on one namespace lock Windows disks treat `\` as a path separator and drop the empty segments it leaves, so `a\b`, `a\\b`, `\a\b` and `a\b\` all address the xl.meta of `a/b`. Namespace locks keyed the raw spelling, so writes, deletes and heals through different spellings ran concurrently on one xl.meta and a read-modify-write in rename_data could drop a version. Fold the object name into its disk identity (rustfs_utils::path:: object_name_disk_identity, a no-op off Windows) wherever a namespace lock key is formed: - SetDisks::new_ns_lock, which every object lock path goes through; - the batch delete lock request and its dedup/lookups, which build ObjectKeys directly. Two consumers compared lock identities by spelling and follow along: - WriteCommitGuard records the folded key from the lock resource, so matching a borrowed guard now folds the target name too; - CopyObject holds the source read guard until EOF on streaming reads. `a\b\` -> `a/b` is not a same-object copy by path_join_buf, but shares one lock, so it now takes the self-copy lock instead of waiting on itself until the lock timeout. Distributed lock keys are folded by the requesting node only; lock servers compare them verbatim. * refactor(ecstore): key the metadata cache by the shared disk identity The metadata cache fix carried its own copy of the Windows backslash folding rule. Use rustfs_utils::path::object_name_disk_identity, which namespace locks already use, so cache and lock identities cannot drift. * ci(windows): run filesystem tests when key identity rules change The Windows backslash folding for object names lives in utils path.rs and is consumed by the namespace lock and write commit guard; run the windows_ tests when any of them changes.