From b8509433c52f7481e1d5948203f6c5b173d675aa Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Fri, 8 Mar 2019 15:50:12 +0100 Subject: [PATCH] rgw admin: disable stale instance delete in a multiste env Signed-off-by: Abhishek Lekshmanan --- src/rgw/rgw_admin.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index 4b457741c31..5f2a1faebe0 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -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; -- 2.39.5