mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-10-30 17:00:48 +01:00
s3: check Object Lock on directory-marker keys before bucket deletion (#11096)
recursivelyCheckLocksWithClient tested EntryHasActiveLock only on non-directory entries, so a directory-marker object (an S3 key ending in "/") that carries retention or a legal hold was recursed into but never lock-checked. DeleteBucket then saw no locks and removed the bucket, destroying an object under active Object Lock along with the rest of the bucket. DeleteObject already enforces the lock on the same key, so the two paths disagreed. Check the directory entry for an active lock before recursing. Claude-Session: https://claude.ai/code/session_011QqNaxZwnpHgMoAZNp3RkY
This commit is contained in:
1 parent
3cdfe648eb
commit
23adeb37e2
2 files changed
+100
No files matched your search
@@ -153,6 +153,13 @@ func recursivelyCheckLocksWithClient(ctx context.Context, client filer_pb.Seawee
|
||||
return false, err
|
||||
}
|
||||
} else {
|
||||
// A directory-marker object (key ending in "/") is stored as a
|
||||
// directory entry and can carry a lock, so check it before recursing.
|
||||
if EntryHasActiveLock(entry, currentTime) {
|
||||
*hasLocks = true
|
||||
glog.V(2).Infof("Found directory marker with active lock: %s/%s", dir, entry.Name)
|
||||
return true, nil
|
||||
}
|
||||
// Recursively check subdirectories
|
||||
if err := recursivelyCheckLocksWithClient(ctx, client, subDir, hasLocks, currentTime); err != nil {
|
||||
return false, err
|
||||
|
||||
Reference in new issue
Block a user