From: Yehuda Sadeh Date: Tue, 10 May 2011 12:15:15 +0000 (-0700) Subject: rgw: switch bucket creation operations X-Git-Tag: v0.28~41 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f00edf73284fc0f6e32973d16f58eb81f7b96bf8;p=ceph.git rgw: switch bucket creation operations First we create the pool, then we create the bucket object. This should have the effect of making the bucket creation sync. --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 1e9faa01250d..8ca01af9f040 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -327,7 +327,8 @@ void RGWCreateBucket::execute() attrs[RGW_ATTR_ACL] = aclbl; - ret = rgw_add_bucket(s->user.user_id, s->bucket_str); + ret = rgwstore->create_bucket(s->user.user_id, s->bucket_str, attrs, + s->user.auid); /* continue if EEXIST and create_bucket will fail below. this way we can recover * from a partial create by retrying it. */ if (ret && ret != -EEXIST) @@ -335,8 +336,7 @@ void RGWCreateBucket::execute() existed = (ret == -EEXIST); - ret = rgwstore->create_bucket(s->user.user_id, s->bucket_str, attrs, - s->user.auid); + ret = rgw_add_bucket(s->user.user_id, s->bucket_str); if (ret && !existed && ret != -EEXIST) /* if it exists (or previously existed), don't remove it! */ rgw_remove_bucket(s->user.user_id, s->bucket_str);