RGW CreateBucket: AWS vs RGW, 200/409 responses
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 20171225035236.EF60F81000ED-2RFepEojUI2gQzYKMK1YzK/[email protected]
Quoted 2 lines · QR
Is anyone know the reason that
ERR_BUCKET_EXISTSis 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.
Signature · 5 lines
Robin Hugh Johnson Gentoo Linux: Dev, Infra Lead, Foundation Asst. Treasurer E-Mail : [email protected] GnuPG FP : 11ACBA4F 4778E3F6 E4EDF38E B27B944E 34884E85 GnuPG FP : 7D0B3CEB E9B85B1F 825BCECF EE05E6F6 A48F6136
_______________________________________________
ceph-users mailing list [email protected]
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com