]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
radosgw-admin: period pull command is not always a raw_storage_op 37464/head
authorCasey Bodley <cbodley@redhat.com>
Mon, 31 Aug 2020 15:19:34 +0000 (11:19 -0400)
committerNathan Cutler <ncutler@suse.com>
Tue, 29 Sep 2020 16:54:19 +0000 (18:54 +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)

Conflicts:
src/rgw/rgw_admin.cc
- nautilus has different (but unrelatedly so) raw_storage_ops_list

src/rgw/rgw_admin.cc

index ad7808352e7876b0e9f229483631838e7dddfe4e..10e353577dc0b211f594ef1f8abee91cdcb7e251 100644 (file)
@@ -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<int> 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) {