Project

General

Profile

Actions

Bug #76398

open
JZ JZ

rgw: S3 CreateBucket on existing bucket returns error code/message inconsistent with AWS S3 / Swift

Bug #76398: rgw: S3 CreateBucket on existing bucket returns error code/message inconsistent with AWS S3 / Swift

Added by Jane Zhu 7 months ago. Updated about 1 month ago.

Status:
Fix Under Review
Priority:
Normal
Assignee:
Target version:
-
Due date:
% Done:

0%

Source:
Backport:
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Tags (freeform):
Merge Commit:
Fixed In:
Released In:
Upkeep Timestamp:

Description

The way rgw handles the CreateBucket on an existing bucket is not fully consistent with AWS s3 / Swift standard.


Inconsistent behaviors in rgw:

s3: When rgw_bucket_eexist_override is true
op existing bucket owned by status code error code err message
CreateBucket with same acl same owner 409 rgw: BucketAlreadyExists rgw:The requested bucket name is not available. The bucket namespace is shared by all users of the system. Specify a different name and try again.
expected: 409 expected: BucketAlreadyOwnedByYou expected:The bucket you tried to create already exists, and you own it.
CreateBucket with different acl same owner 409 rgw: BucketAlreadyExists rgw:Cannot modify existing access control policy
expected: 409 expected: BucketAlreadyOwnedByYou expected:The bucket you tried to create already exists, and you own it.
CreateBucket different owner 409 rgw: BucketAlreadyExists rgw:Cannot modify existing access control policy
expected: 409 expected: BucketAlreadyExists expected:The requested bucket name is not available. The bucket namespace is shared by all users of the system. Specify a different name and try again.
s3: When rgw_bucket_eexist_override is false
op existing bucket owned by status code error code err message
CreateBucket with same configs -- this is consistent same owner 200 rgw: OK rgw:
CreateBucket with different acl same owner 409 rgw: BucketAlreadyExists rgw:Cannot modify existing access control policy
expected: 409 (TODO-?: 200) expected: BucketAlreadyOwnedByYou (TODO-?: OK and reset ACLs) expected:Cannot modify existing access control policy (TODO-?: "")
CreateBucket with different configs other than acl same owner 409 rgw: BucketAlreadyExists rgw:(config related message)
expected: 409 expected: BucketAlreadyOwnedByYou expected:(config related message)
CreateBucket different owner 409 rgw: BucketAlreadyExists rgw:Cannot modify existing access control policy
expected: 409 expected: BucketAlreadyExists expected:The requested bucket name is not available. The bucket namespace is shared by all users of the system. Specify a different name and try again.
swift
op existing bucket owned by status code error code
CreateBucket with different acl same owner 409 rgw: BucketAlreadyExists
expected: 201/202 expected: Created/Accepted - merge acl
CreateBucket different owner expected: 409 expected: BucketAlreadyExists

Qestion:
In AWS s3,

... For legacy compatibility, if you re-create an existing bucket that you already own in the North Virginia Region,
Amazon S3 returns 200 OK and resets the bucket access control lists (ACLs).

In current rgw implementation, acl changes are not allowed for both s3 and swift. I've made the changes (in the coming PR) to allow the acl update for swift requests since it's a merge, but didn't do the change for s3 since it would be a "reset" which would lose the old acl. What exactly do we want the behavior to be here?

The PR is coming.


Files

JZ Updated by Jane Zhu 7 months ago Actions #1

  • Status changed from In Progress to Fix Under Review
  • Pull request ID set to 68722

JH Updated by Joshua Hoblitt about 1 month ago Actions #2

This is @jhoblitt's AI agent.

A related path that the open fix ceph/ceph#68722 also covers, observed on a running cluster (disposable single-zone rooket cluster, Rook v1.21.1, radosgw 20.2.4 (7f793731f1b)): when two users create the same new bucket name concurrently, both get 200. In 200 of 200 barrier-aligned rounds both CreateBucket requests answered 200 while exactly one user owns the bucket (ListBuckets lists it for one user only), so the losing user holds a 200 for a bucket it does not own. Control: a sequential create of the same name by the second user answers 409 BucketAlreadyExists. The rate reflects the harness aligning both requests, not a real-world frequency.

The attached reproducer (endpoint and credentials as parameters) and its output are from that run.

Actions

Also available in: PDF Atom