]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.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)
committerPrashant D <pdhange@redhat.com>
Tue, 16 Apr 2019 02:11:24 +0000 (22:11 -0400)
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit b8509433c52f7481e1d5948203f6c5b173d675aa)

src/rgw/rgw_admin.cc

index 51b6178e4fbd99611ae9415157309d883bd336ac..118d374325e0d7edad4be97527a5304ccf39efb9 100644 (file)
@@ -7862,6 +7862,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;