From: Adam C. Emerson Date: Tue, 12 Apr 2022 23:44:48 +0000 (-0400) Subject: rgw: RGWBucketPipeSyncStatusManager doesn't need a conn X-Git-Tag: v18.0.0~787^2~16 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c7cc19ed5a254ae19415d2c8ce818c53572f4cc1;p=ceph.git rgw: RGWBucketPipeSyncStatusManager doesn't need a conn `conn` is per-source. last_zone just saved a lookup in a small map. Signed-off-by: Adam C. Emerson --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index c9701bf382499..abf4367b3f440 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -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; diff --git a/src/rgw/rgw_data_sync.h b/src/rgw/rgw_data_sync.h index d54a20bc0793b..fdfda1a079264 100644 --- a/src/rgw/rgw_data_sync.h +++ b/src/rgw/rgw_data_sync.h @@ -720,7 +720,6 @@ class RGWBucketPipeSyncStatusManager : public DoutPrefixProvider { std::optional source_zone; std::optional source_bucket; - RGWRESTConn* conn = nullptr; std::unique_ptr error_logger = std::make_unique(store, RGW_SYNC_ERROR_LOG_SHARD_PREFIX, ERROR_LOGGER_SHARDS);