]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: period pull command is not always a raw_storage_op 37336/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 31 Aug 2020 15:19:34 +0000 (11:19 -0400)
committerNathan Cutler <ncutler@suse.com>
Wed, 23 Sep 2020 11:16:09 +0000 (13:16 +0200)
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 <cbodley@redhat.com>
(cherry picked from commit 2b44a9d060d33dca9768c758e1908365488aac2a)

src/rgw/rgw_admin.cc

index 6831a78ed23e94aacb787754d5f6fa31ddd31f4c..7db127f69baa415a1ca8cd0b0a006712bfd2975c 100644 (file)
@@ -3790,6 +3790,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<OPT> 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,
@@ -3807,7 +3810,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,
@@ -3878,7 +3880,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) {