From: Yehuda Sadeh Date: Tue, 15 Mar 2016 22:56:38 +0000 (-0700) Subject: Merge pull request #8095 from yehudasa/wip-rgw-sync-fixes X-Git-Tag: v10.1.0~72 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=af4d4018682afe40415abda2d21f53bf5e1b3f32;p=ceph.git Merge pull request #8095 from yehudasa/wip-rgw-sync-fixes rgw sync fixes Reviewed-by: Casey Bodley --- af4d4018682afe40415abda2d21f53bf5e1b3f32 diff --cc src/rgw/rgw_rados.cc index a8d74649813d,83ed902fc718..487477618900 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@@ -10405,10 -10360,22 +10405,22 @@@ int RGWRados::put_bucket_instance_info( string key; get_bucket_instance_entry(info.bucket, key); /* when we go through meta api, we don't use oid directly */ - return rgw_bucket_instance_store_info(this, key, bl, exclusive, pattrs, &info.objv_tracker, mtime); + int ret = rgw_bucket_instance_store_info(this, key, bl, exclusive, pattrs, &info.objv_tracker, mtime); + if (ret == -EEXIST) { + /* well, if it's exclusive we shouldn't overwrite it, because we might race with another + * bucket operation on this specific bucket (e.g., being synced from the master), but + * since bucket instace meta object is unique for this specific bucket instace, we don't + * need to return an error. + * A scenario where we'd get -EEXIST here, is in a multi-zone config, we're not on the + * master, creating a bucket, sending bucket creation to the master, we create the bucket + * locally, while in the sync thread we sync the new bucket. + */ + ret = 0; + } + return ret; } -int RGWRados::put_linked_bucket_info(RGWBucketInfo& info, bool exclusive, time_t mtime, obj_version *pep_objv, +int RGWRados::put_linked_bucket_info(RGWBucketInfo& info, bool exclusive, real_time mtime, obj_version *pep_objv, map *pattrs, bool create_entry_point) { bufferlist bl;