]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/multisite: empty realm_id and period_id passed into do_period_pull()
authorShilpa Jagannath <smanjara@redhat.com>
Thu, 18 Sep 2025 20:37:18 +0000 (16:37 -0400)
committerShilpa Jagannath <smanjara@redhat.com>
Fri, 19 Sep 2025 19:03:37 +0000 (15:03 -0400)
was causing remote zone to respond with 404 error during a period pull.

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
src/rgw/radosgw-admin/radosgw-admin.cc

index 4f4bb112063e3be6a3dd9e70c193e2b1a70f4435..45ec24093a51d92a89d2d652bcfa28f894ca84b6 100644 (file)
@@ -4883,41 +4883,22 @@ int main(int argc, const char **argv)
       break;
     case OPT::PERIOD_PULL:
       {
-        boost::optional<RGWRESTConn> conn;
-        RGWRESTConn *remote_conn = nullptr;
         if (url.empty()) {
-          // load current period for endpoints
-          RGWRealm realm;
-          int ret = rgw::read_realm(dpp(), null_yield, cfgstore.get(),
-                                    realm_id, realm_name, realm);
-          if (ret < 0 ) {
-            cerr << "failed to load realm: " << cpp_strerror(-ret) << std::endl;
-            return -ret;
-          }
-          period_id = realm.current_period;
-
-          RGWPeriod current_period;
-          ret = cfgstore->read_period(dpp(), null_yield, period_id,
-                                      std::nullopt, current_period);
-          if (ret < 0) {
-            cerr << "failed to load current period: " << cpp_strerror(-ret) << std::endl;
-            return -ret;
-          }
-          if (remote.empty()) {
-            // use realm master zone as remote
-            remote = current_period.get_master_zone().id;
-          }
-          conn = get_remote_conn(static_cast<rgw::sal::RadosStore*>(driver), current_period.get_map(), remote);
-          if (!conn) {
-            cerr << "failed to find a zone or zonegroup for remote "
-                << remote << std::endl;
-            return -ENOENT;
-          }
-          remote_conn = &*conn;
+          cerr << "A --url must be provided." << std::endl;
+          return EINVAL;
+        }
+        // load realm for current period
+        RGWRealm realm;
+        int ret = rgw::read_realm(dpp(), null_yield, cfgstore.get(),
+                                  realm_id, realm_name, realm);
+        if (ret < 0 ) {
+          cerr << "failed to load realm: " << cpp_strerror(-ret) << std::endl;
+          return -ret;
         }
+        period_id = realm.current_period;
 
         RGWPeriod period;
-        int ret = do_period_pull(cfgstore.get(), remote_conn, url,
+        ret = do_period_pull(cfgstore.get(), nullptr, url,
                                  opt_region, access_key, secret_key,
                                  realm_id, realm_name, period_id, period_epoch,
                                  &period);