From 094fe3f0cfeb27b32abfc93b07054b60de363a20 Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Sat, 24 Sep 2016 10:46:36 -0700 Subject: [PATCH] rgw_admin: reshard also links to new bucket instance Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_admin.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 5f46f6e1b3b..bfa072f444a 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -4836,6 +4836,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) { -- 2.39.5