]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #8095 from yehudasa/wip-rgw-sync-fixes
authorYehuda Sadeh <yehuda@redhat.com>
Tue, 15 Mar 2016 22:56:38 +0000 (15:56 -0700)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 15 Mar 2016 22:56:38 +0000 (15:56 -0700)
rgw sync fixes

Reviewed-by: Casey Bodley <cbodley@redhat.com>
1  2 
src/common/config_opts.h
src/rgw/rgw_data_sync.cc
src/rgw/rgw_rados.cc
src/rgw/rgw_sync.cc
src/rgw/rgw_sync.h

Simple merge
Simple merge
index a8d74649813dd932e0b406445437c3f248186fe3,83ed902fc718dad31d9ef965d92cf1d0a3184aad..487477618900ab82738d326e2c21b9e5063cd115
@@@ -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<string, bufferlist> *pattrs, bool create_entry_point)
  {
    bufferlist bl;
Simple merge
Simple merge