]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add exclusive flag to RGWRealm::create_control
authorCasey Bodley <cbodley@redhat.com>
Thu, 31 Mar 2016 16:16:08 +0000 (12:16 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 1 Apr 2016 16:01:24 +0000 (12:01 -0400)
this was causing failures in 'radosgw-admin realm pull':

  ERROR creating control for new realm realm0: (17) File exists

'realm pull' calls RGWRealm::create() with exclusive=false, but
RGWRealm::create_control() was using exclusive=true

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc
src/rgw/rgw_rados.h

index 0698941bd670e72cdf3927dccf8a6ca4cb0e06dd..354ed78ea8a234f1f469b1c43da48dd35f3d76f4 100644 (file)
@@ -703,7 +703,7 @@ int RGWRealm::create(bool exclusive)
     return ret;
   }
   // create the control object for watch/notify
-  ret = create_control();
+  ret = create_control(exclusive);
   if (ret < 0) {
     ldout(cct, 0) << "ERROR creating control for new realm " << name << ": " << cpp_strerror(-ret) << dendl;
     return ret;
@@ -753,12 +753,12 @@ int RGWRealm::delete_obj()
   return delete_control();
 }
 
-int RGWRealm::create_control()
+int RGWRealm::create_control(bool exclusive)
 {
   auto pool_name = get_pool_name(cct);
   auto pool = rgw_bucket{pool_name.c_str()};
   auto oid = get_control_oid();
-  return rgw_put_system_obj(store, pool, oid, nullptr, 0, true,
+  return rgw_put_system_obj(store, pool, oid, nullptr, 0, exclusive,
                             nullptr, real_time(), nullptr);
 }
 
index a1aa819402137c2cda51e267fa4b8054f5bf32c4..e26592174f32b676cf724b2118b12bd76ed39f05 100644 (file)
@@ -1301,7 +1301,7 @@ class RGWRealm : public RGWSystemMetaObj
   string current_period;
   epoch_t epoch{0}; //< realm epoch, incremented for each new period
 
-  int create_control();
+  int create_control(bool exclusive);
   int delete_control();
 public:
   RGWRealm() {}