]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: bucket resharding should not update bucket ACL or user stats 20327/head
authorOrit Wasserman <owasserm@redhat.com>
Sun, 21 Jan 2018 08:12:43 +0000 (10:12 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Mon, 5 Feb 2018 18:27:59 +0000 (19:27 +0100)
bucket link op resets bucket ACL using rgw_link_bucket instead

Fixes: http://tracker.ceph.com/issues/22124
Fixes: http://tracker.ceph.com/issues/22742
Signed-off-by: Orit Wasserman <owasserm@redhat.com>
(cherry picked from commit 1223baf76b45559f171c67c5e737f8e5f7d843e0)

src/rgw/rgw_reshard.cc
src/rgw/rgw_reshard.h

index f5a4b4a22517913534ee527f2e32f2e388cbd113..6fcc5f34367a163d6f0eda1ffe5e0a5286cef1e6 100644 (file)
@@ -346,7 +346,7 @@ public:
 
 int RGWBucketReshard::do_reshard(
                   int num_shards,
-                  const RGWBucketInfo& new_bucket_info,
+                  RGWBucketInfo& new_bucket_info,
                   int max_entries,
                    bool verbose,
                    ostream *out,
@@ -470,16 +470,10 @@ int RGWBucketReshard::do_reshard(
     return EIO;
   }
 
-  RGWBucketAdminOpState bucket_op;
-
-  bucket_op.set_bucket_name(new_bucket_info.bucket.name);
-  bucket_op.set_bucket_id(new_bucket_info.bucket.bucket_id);
-  bucket_op.set_user_id(new_bucket_info.owner);
-  string err;
-  int r = RGWBucketAdminOp::link(store, bucket_op, &err);
-  if (r < 0) {
-    lderr(store->ctx()) << "failed to link new bucket instance (bucket_id=" << new_bucket_info.bucket.bucket_id << ": " << err << "; " << cpp_strerror(-r) << ")" << dendl;
-    return -r;
+  ret = rgw_link_bucket(store, new_bucket_info.owner, new_bucket_info.bucket, bucket_info.creation_time);
+  if (ret < 0) {
+    lderr(store->ctx()) << "failed to link new bucket instance (bucket_id=" << new_bucket_info.bucket.bucket_id << ": " << cpp_strerror(-ret) << ")" << dendl;
+    return -ret;
   }
 
   ret = bucket_info_updater.complete();
index 8c1734b8951b1b16c8975bec4bce83af35f9d3a2..e5d658531c8a01b7cb2039f30b445f5c00a63068 100644 (file)
@@ -31,7 +31,7 @@ class RGWBucketReshard {
 
   int create_new_bucket_instance(int new_num_shards, RGWBucketInfo& new_bucket_info);
   int do_reshard(int num_shards,
-                const RGWBucketInfo& new_bucket_info,
+                RGWBucketInfo& new_bucket_info,
                 int max_entries,
                  bool verbose,
                  ostream *os,