]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_admin: reshard also links to new bucket instance
authorYehuda Sadeh <yehuda@redhat.com>
Sat, 24 Sep 2016 17:46:36 +0000 (10:46 -0700)
committerRobin H. Johnson <robin.johnson@dreamhost.com>
Thu, 9 Feb 2017 22:36:29 +0000 (14:36 -0800)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
(cherry picked from commit 094fe3f0cfeb27b32abfc93b07054b60de363a20)
See: http://tracker.ceph.com/issues/17556
See: https://github.com/ceph/ceph/pull/11368
Signed-off-by: Robin H. Johnson <robin.johnson@dreamhost.com>
src/rgw/rgw_admin.cc

index 3996bfd6e160be0188f617ab14293c9c3ae98704..f897854e6b74f9d8d5cc430022da86a106ce351b 100644 (file)
@@ -5007,6 +5007,15 @@ next:
       }
       delete target_shards[i];
     }
+
+    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) {
+      cerr << "failed to link new bucket instance (bucket_id=" << new_bucket_info.bucket.bucket_id << ": " << err << "; " << cpp_strerror(-r) << std::endl;
+      return -r;
+    }
   }
 
   if (opt_cmd == OPT_OBJECT_UNLINK) {