]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWBucketPipeSyncStatusManager doesn't need a conn
authorAdam C. Emerson <aemerson@redhat.com>
Tue, 12 Apr 2022 23:44:48 +0000 (19:44 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 27 May 2022 19:47:34 +0000 (15:47 -0400)
`conn` is per-source. last_zone just saved a lookup in a small map.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/rgw/rgw_data_sync.cc
src/rgw/rgw_data_sync.h

index c9701bf38249980cb5569afd4aeeb8e20e334817..abf4367b3f4401f1f144f79f557ea435dde03f4b 100644 (file)
@@ -5414,18 +5414,13 @@ int RGWBucketPipeSyncStatusManager::init(const DoutPrefixProvider *dpp)
     return ret;
   }
 
-  rgw_zone_id last_zone;
-
   for (auto& pipe : pipes) {
     auto& szone = pipe.source.zone;
 
-    if (last_zone != szone) {
-      conn = store->svc()->zone->get_zone_conn(szone);
-      if (!conn) {
-        ldpp_dout(this, 0) << "connection object to zone " << szone << " does not exist" << dendl;
-        return -EINVAL;
-      }
-      last_zone = szone;
+    auto conn = store->svc()->zone->get_zone_conn(szone);
+    if (!conn) {
+      ldpp_dout(this, 0) << "connection object to zone " << szone << " does not exist" << dendl;
+      return -EINVAL;
     }
 
     rgw_bucket_index_marker_info remote_info;
index d54a20bc0793bd66fdad5cf7a60793355aca465c..fdfda1a079264dac3f849da7368050d7ae82df27 100644 (file)
@@ -720,7 +720,6 @@ class RGWBucketPipeSyncStatusManager : public DoutPrefixProvider {
   std::optional<rgw_zone_id> source_zone;
   std::optional<rgw_bucket> source_bucket;
 
-  RGWRESTConn* conn = nullptr;
   std::unique_ptr<RGWSyncErrorLogger> error_logger =
     std::make_unique<RGWSyncErrorLogger>(store, RGW_SYNC_ERROR_LOG_SHARD_PREFIX,
                                         ERROR_LOGGER_SHARDS);