[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ceph-devel
Subject:    RGW CreateBucket: AWS vs RGW, 200/409 responses
From:       "Robin H. Johnson" <robbat2 () gentoo ! org>
Date:       2017-12-25 6:28:01
Message-ID: robbat2-20171225T061012-699561209Z () orbis-terrarum ! net
[Download RAW message or body]

On Mon, Dec 25, 2017 at 11:52:36AM +0800, QR wrote:
> Is anyone know the reason that ERR_BUCKET_EXISTS is modified to zero?
> Thanks.
This comes down to arguing about AWS S3 CreateBucket behavior if the
bucket already existed and was owned by you (plus which region it is in
vs where the request was made to).
AWS S3 us-east-1: returns 200 OK
AWS S3 other regions: return 409 Conflict: BucketAlreadyOwnedByYou

RGW implements the 200-OK behavior, which is why the return is modified
to zero (ret==0 -> HTTP 200 OK).

I created issue 17398 a year ago to discuss it:
http://tracker.ceph.com/issues/17398

I see recently that issue 22279 was created for the same thing, with an
attached PR, but the same discussion.
http://tracker.ceph.com/issues/22279
https://github.com/ceph/ceph/pull/19249

Yehuda's opinion is that the 200-OK behavior is better, because
CreateBucket should be an idempotent operation.

My opinion is that the 409-BucketAlreadyOwnedByYou behavior is better,
because the CreateBucket annoyingly is actually two operations:
(CreateBucket, SetBucketACL).
If the bucket does already exist, but the ACLs you pass in bucket
creation are NOT the same as the existing bucket ACLs, what should
happen?
- Skip creation, skip ACLs? 200-OK response is dangerously misleading here.
- Skip creation, replace ACLs? This is going to overwrite the existing
  ACLs, rather than modify them.
- Do nothing and issue a warning about ACL mismatch? Annoying in that
  we're diverging more from AWS behavior.

AWS S3 went to 409-BucketAlreadyOwnedByYou for a reason. They've never
stated exactly why, but I believe their choice makes sense.

-- 
Robin Hugh Johnson
Gentoo Linux: Dev, Infra Lead, Foundation Asst. Treasurer
E-Mail   : robbat2@gentoo.org
GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85
GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136

["signature.asc" (application/pgp-signature)]
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic