Project

General

Profile

Support #4775

Why I can created an exsiting bucket

Added by manx suo almost 11 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Normal
Target version:
-
% Done:

0%

Tags:
Reviewed:
Affected Versions:
Pull request ID:

Description

There is a bucket named abcdef in the ceph. It contains 5 objects.

Then I create a new bucket with the same name abcdef, and get a sucessful response! And it contains the same 5 objects.
How can this happened?

History

#1 Updated by Loïc Dachary over 9 years ago

  • Project changed from Ceph to rgw

#2 Updated by Javier M. Mellid over 8 years ago

  • Status changed from New to Resolved
  • Assignee set to Javier M. Mellid

'create bucket' is designed to be idempotent. Clients can make the same call repeatedly while producing the same result. In other words, making multiple identical requests has the same effect on the server (no side effects) as making a single request although the response itself may not be the same (i.e. timestamps and so on)

Documentation is up to date and it is clear. You can have a look at:

http://ceph.com/docs/master/radosgw/s3/bucketops/#put-bucket

"... If a bucket with the same name already exists and the user is the bucket owner, the operation will succeed ..."

While this behaviour could look weird, it is useful and "cheap". You can think about race conditions while creating your buckets, handling concurrency and so on. The current behaviour makes sense and it works as expected. If you want to create one bucket and that bucket exists and you are the owner, the server just returns Okay. It doesn't need to re-create it.

BTW, if you need to know if the bucket exists you can run a previous lookup (get bucket)

Also available in: Atom PDF