From: Sage Weil Date: Tue, 29 Mar 2011 19:39:46 +0000 (-0700) Subject: rgw: add bucket to user list prior to creating bucket X-Git-Tag: v0.27~225 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ab03eda62a7f58704bbf5cb03bceb90423e01d64;p=ceph.git rgw: add bucket to user list prior to creating bucket This avoids hitting the osd immediately following a bucket creation, which will avoid any map update latency for most requests. Signed-off-by: Sage Weil --- diff --git a/src/rgw/rgw_op.cc b/src/rgw/rgw_op.cc index 2843f63a3f14..a24a6a8b4f87 100644 --- a/src/rgw/rgw_op.cc +++ b/src/rgw/rgw_op.cc @@ -313,11 +313,15 @@ void RGWCreateBucket::execute() attrs[RGW_ATTR_ACL] = aclbl; + ret = rgw_add_bucket(s->user.user_id, s->bucket_str); + if (ret) + goto done; + ret = rgwstore->create_bucket(s->user.user_id, s->bucket_str, attrs, s->user.auid); + if (ret) + rgw_remove_bucket(s->user.user_id, s->bucket_str); - if (ret == 0) - ret = rgw_add_bucket(s->user.user_id, s->bucket_str); done: send_response(); }