From: Abhishek Lekshmanan Date: Fri, 8 Mar 2019 14:50:12 +0000 (+0100) Subject: rgw admin: disable stale instance delete in a multiste env X-Git-Tag: v14.2.1~8^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=47cd6e67321ee3344e0671c1153f4cd879c20096;p=ceph.git rgw admin: disable stale instance delete in a multiste env Signed-off-by: Abhishek Lekshmanan (cherry picked from commit b8509433c52f7481e1d5948203f6c5b173d675aa) --- diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 51b6178e4fb..118d374325e 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -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;