mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-09-20 13:30:46 +02:00
s3: keep object-lock buckets fully on the distributed lock
objectWriteOwner now returns "" for object-lock (WORM) buckets, so versioned PutObject / copy / delete-marker no longer route them off the lock. Routed writes serialize on the owner's per-path entry lock while retention-checked deletes use the distributed lock, and those two locks don't serialize against each other; an object-lock bucket that routed some writes and not others would split-brain on the same object. Retention enforcement is gateway-side and not part of the per-path-locked filer ops, so the whole bucket stays on the distributed lock and remains internally consistent. The now-redundant gate is dropped from routedObjectOwner.
This commit is contained in:
@@ -28,9 +28,8 @@ func (s3a *S3ApiServer) routedObjectOwner(bucket, object string) (pb.ServerAddre
|
||||
if enabled, err := s3a.isVersioningEnabled(bucket); err != nil || enabled {
|
||||
return "", false
|
||||
}
|
||||
if locked, err := s3a.isObjectLockEnabled(bucket); err != nil || locked {
|
||||
return "", false
|
||||
}
|
||||
// objectWriteOwner already excludes object-lock buckets (they stay fully on
|
||||
// the distributed lock), returning "" for them.
|
||||
owner := s3a.objectWriteOwner(bucket, object)
|
||||
if owner == "" {
|
||||
return "", false
|
||||
|
||||
Reference in New Issue
Block a user