S3 Gateway: race between bucket deletion and multipart upload creation
DeleteBucket and NewMultipartUpload are not serialized.
NewMultipartUpload first checks that the bucket exists, then creates upload data independently under .sys/<bucket>/uploads. The bucket may be deleted between these operations, causing the multipart upload to return success after the bucket has already been removed.
Similarly, DeleteBucket may check that no multipart uploads exist while a concurrent upload is being created, then delete the bucket and leave the new upload orphaned.
A distributed per-bucket lock is required to make bucket deletion and multipart upload creation mutually exclusive across Gateway instances.
S3 Gateway: race between bucket deletion and multipart upload creation
DeleteBucketandNewMultipartUploadare not serialized.NewMultipartUploadfirst checks that the bucket exists, then creates upload data independently under.sys/<bucket>/uploads. The bucket may be deleted between these operations, causing the multipart upload to return success after the bucket has already been removed.Similarly,
DeleteBucketmay check that no multipart uploads exist while a concurrent upload is being created, then delete the bucket and leave the new upload orphaned.A distributed per-bucket lock is required to make bucket deletion and multipart upload creation mutually exclusive across Gateway instances.