mirror of
https://github.com/rustfs/rustfs.git
synced 2026-07-27 00:38:16 +00:00
78df276d25
* fix(ecstore): skip hidden metadata in walk limit * fix(ecstore): match walk limit to visible versions * fix(ecstore): avoid decoding all versions for limit * fix: return 503 on lock contention instead of 500 When concurrent PUTs to the same key contend for the namespace write lock, lock timeout and conflict errors were wrapped as StorageError::other(...) → StorageError::Io(...), which fell through to S3ErrorCode::InternalError (500) in the error mapping. Only QuorumNotReached was correctly mapped to ServiceUnavailable (503); all other lock errors (Timeout, AlreadyLocked, etc.) became 500. Fix: map_namespace_lock_error now returns StorageError::Lock(err) for non-quorum lock errors, and StorageError::Lock is mapped to S3ErrorCode::ServiceUnavailable in the HTTP error conversion. Affected paths: - crates/ecstore/src/set_disk/lock.rs - crates/ecstore/src/store/object.rs - crates/ecstore/src/store/bucket.rs (make_bucket, delete_bucket) - rustfs/src/app/object_usecase.rs (copy_object) Regression test: test_concurrent_put_same_key_never_returns_500 * test: fail on unexpected lock contention errors --------- Co-authored-by: houseme <housemecn@gmail.com>