]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: bucket resharding should not update bucket ACL or user stats 20038/head
authorOrit Wasserman <owasserm@redhat.com>
Sun, 21 Jan 2018 08:12:43 +0000 (10:12 +0200)
committerOrit Wasserman <owasserm@redhat.com>
Sun, 4 Feb 2018 14:02:58 +0000 (16:02 +0200)
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>
src/rgw/rgw_reshard.cc
src/rgw/rgw_reshard.h

index 71726634a5a227f5c8c3fa6095f44795d986152d..04e95aabfd1835b4f58dcf75002d7d3b68a462e8 100644 (file)
@@ -345,7 +345,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,
@@ -469,16 +469,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,