]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove placement_rule from rgw_link_bucket()
authorCasey Bodley <cbodley@redhat.com>
Tue, 31 Oct 2017 20:29:31 +0000 (16:29 -0400)
committerNathan Cutler <ncutler@suse.com>
Mon, 6 Nov 2017 12:35:40 +0000 (13:35 +0100)
with the fallback in RGWRados::update_containers_stats(), we no longer
need to pass placement_rule into the cls_user_bucket_entry

this removes the dependency between bucket entrypoint metadata and its
bucket instance metadata during multisite sync

Fixes: http://tracker.ceph.com/issues/21990
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit dd5d278a4f9b080234cbb77e448208803ec0cf93)

src/rgw/rgw_bucket.cc
src/rgw/rgw_bucket.h
src/rgw/rgw_op.cc

index 1c946919d786e5e530c1705260714d429df76ad2..2a38733aa2966740b3dcbc1dec48eba6e8fb56fe 100644 (file)
@@ -184,7 +184,6 @@ int rgw_link_bucket(RGWRados* const store,
                     const rgw_user& user_id,
                     rgw_bucket& bucket,
                     ceph::real_time creation_time,
-                    std::string placement_rule,
                     bool update_entrypoint)
 {
   int ret;
@@ -192,7 +191,6 @@ int rgw_link_bucket(RGWRados* const store,
   string& bucket_name = bucket.name;
 
   cls_user_bucket_entry new_bucket;
-  new_bucket.placement_rule = placement_rule;
 
   RGWBucketEntryPoint ep;
   RGWObjVersionTracker ot;
@@ -485,8 +483,7 @@ void check_bad_user_bucket_mapping(RGWRados *store, const rgw_user& user_id,
         if (fix) {
           cout << "fixing" << std::endl;
           r = rgw_link_bucket(store, user_id, actual_bucket,
-                              bucket_info.creation_time,
-                              bucket_info.placement_rule);
+                              bucket_info.creation_time);
           if (r < 0) {
             cerr << "failed to fix bucket: " << cpp_strerror(-r) << std::endl;
           }
@@ -904,7 +901,7 @@ int RGWBucket::link(RGWBucketAdminOpState& op_state, std::string *err_msg)
     }
 
     r = rgw_link_bucket(store, user_info.user_id, bucket_info.bucket,
-                        ceph::real_time(), bucket_info.placement_rule);
+                        ceph::real_time());
     if (r < 0) {
       return r;
     }
@@ -2130,15 +2127,7 @@ public:
 
     /* link bucket */
     if (be.linked) {
-      RGWObjectCtx ctx(store);
-      RGWBucketInfo bucket_info;
-      ret = store->get_bucket_info(ctx, tenant_name, bucket_name,
-                                   bucket_info, nullptr, nullptr);
-      if (ret < 0) {
-        return ret;
-      }
-      ret = rgw_link_bucket(store, be.owner, be.bucket, be.creation_time,
-                            bucket_info.placement_rule, false);
+      ret = rgw_link_bucket(store, be.owner, be.bucket, be.creation_time, false);
     } else {
       ret = rgw_unlink_bucket(store, be.owner, be.bucket.tenant,
                               be.bucket.name, false);
index 6cc272d800a6384b738450763f6919fb4464e1bb..62b29232588279b64f93c1af978d2e16e369794c 100644 (file)
@@ -180,7 +180,6 @@ extern int rgw_link_bucket(RGWRados* store,
                            const rgw_user& user_id,
                            rgw_bucket& bucket,
                            ceph::real_time creation_time,
-                           std::string placement_rule,
                            bool update_entrypoint = true);
 extern int rgw_unlink_bucket(RGWRados *store, const rgw_user& user_id,
                              const string& tenant_name, const string& bucket_name, bool update_entrypoint = true);
index 8bd1f4ea82d0516f2c70bf8498cf8ebcae18b86b..11fdbd4ebc3fdb95863baf710c0cd52da11a9574 100644 (file)
@@ -2763,7 +2763,7 @@ void RGWCreateBucket::execute()
   }
 
   op_ret = rgw_link_bucket(store, s->user->user_id, s->bucket,
-                          info.creation_time, info.placement_rule, false);
+                          info.creation_time, false);
   if (op_ret && !existed && op_ret != -EEXIST) {
     /* if it exists (or previously existed), don't remove it! */
     op_ret = rgw_unlink_bucket(store, s->user->user_id, s->bucket.tenant,
@@ -6294,8 +6294,8 @@ int RGWBulkUploadOp::handle_dir(const boost::string_ref path)
     bucket = out_info.bucket;
   }
 
-  op_ret = rgw_link_bucket(store, s->user->user_id,bucket, out_info.creation_time,
-                           out_info.placement_rule, false);
+  op_ret = rgw_link_bucket(store, s->user->user_id, bucket,
+                           out_info.creation_time, false);
   if (op_ret && !existed && op_ret != -EEXIST) {
     /* if it exists (or previously existed), don't remove it! */
     op_ret = rgw_unlink_bucket(store, s->user->user_id,