From c5a011ea9a0726b5b717046447b3c6120a88c7ce Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 31 Aug 2020 11:19:34 -0400 Subject: [PATCH] radosgw-admin: period pull command is not always a raw_storage_op if a --url is given, 'period pull' does not depend on any zone/period configuration and can be a raw_storage_op. if we get a --remote instead, we do need to initialize the zone/period configuration to find the correct endpoint/access keys Fixes: https://tracker.ceph.com/issues/47217 Signed-off-by: Casey Bodley (cherry picked from commit 2b44a9d060d33dca9768c758e1908365488aac2a) Conflicts: src/rgw/rgw_admin.cc - nautilus has different (but unrelatedly so) raw_storage_ops_list --- src/rgw/rgw_admin.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_admin.cc b/src/rgw/rgw_admin.cc index ad7808352e787..10e353577dc0b 100644 --- a/src/rgw/rgw_admin.cc +++ b/src/rgw/rgw_admin.cc @@ -3368,6 +3368,9 @@ int main(int argc, const char **argv) // not a raw op if 'period update' needs to commit to master bool raw_period_update = opt_cmd == OPT_PERIOD_UPDATE && !commit; + // not a raw op if 'period pull' needs to read zone/period configuration + bool raw_period_pull = opt_cmd == OPT_PERIOD_PULL && !url.empty(); + std::set raw_storage_ops_list = {OPT_ZONEGROUP_ADD, OPT_ZONEGROUP_CREATE, OPT_ZONEGROUP_DELETE, OPT_ZONEGROUP_GET, OPT_ZONEGROUP_LIST, OPT_ZONEGROUP_SET, OPT_ZONEGROUP_DEFAULT, @@ -3385,7 +3388,6 @@ int main(int argc, const char **argv) OPT_ZONE_PLACEMENT_GET, OPT_REALM_CREATE, OPT_PERIOD_DELETE, OPT_PERIOD_GET, - OPT_PERIOD_PULL, OPT_PERIOD_GET_CURRENT, OPT_PERIOD_LIST, OPT_GLOBAL_QUOTA_GET, OPT_GLOBAL_QUOTA_SET, OPT_GLOBAL_QUOTA_ENABLE, OPT_GLOBAL_QUOTA_DISABLE, @@ -3451,7 +3453,7 @@ int main(int argc, const char **argv) }; bool raw_storage_op = (raw_storage_ops_list.find(opt_cmd) != raw_storage_ops_list.end() || - raw_period_update); + raw_period_update || raw_period_pull); bool need_cache = readonly_ops_list.find(opt_cmd) == readonly_ops_list.end(); if (raw_storage_op) { -- 2.39.5