]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw admin: disable stale instance delete in a multiste env
authorAbhishek Lekshmanan <abhishek@suse.com>
Fri, 8 Mar 2019 14:50:12 +0000 (15:50 +0100)
committerAbhishek Lekshmanan <abhishek@suse.com>
Mon, 11 Mar 2019 14:31:43 +0000 (15:31 +0100)
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_admin.cc

index 4b457741c313db283e9c5085adde71cbbc274f39..5f2a1faebe03a00ebc7d22b80a55493f94903243 100644 (file)
@@ -7843,6 +7843,11 @@ next:
  }
 
  if (opt_cmd == OPT_RESHARD_STALE_INSTANCES_DELETE) {
+   if (!store->svc.zone->can_reshard()) {
+     cerr << "Resharding disabled in a multisite env. Stale instances are not safe to be deleted." << std::endl;
+     return EINVAL;
+   }
+
    ret = RGWBucketAdminOp::clear_stale_instances(store, bucket_op,f);
    if (ret < 0) {
      cerr << "ERROR: deleting stale instances" << cpp_strerror(-ret) << std::endl;