From b3d54c811548ab65078a3fa81d4ac4ab61377993 Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Thu, 30 Jun 2022 13:48:04 -0400 Subject: [PATCH] rgw: RGWBucketPipeSyncStatusManager gets zone name on construction So we can print it in the user friendly messages to come. Signed-off-by: Adam C. Emerson --- src/rgw/rgw_data_sync.cc | 8 +++++++- src/rgw/rgw_data_sync.h | 7 +++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 2662a9ab075..fe420de82d5 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -5370,10 +5370,16 @@ int RGWBucketPipeSyncStatusManager::do_init(const DoutPrefixProvider *dpp) ldpp_dout(this, 0) << "connection object to zone " << szone << " does not exist" << dendl; return -EINVAL; } + + RGWZone* z; + if (!(z = store->svc()->zone->find_zone(szone))) { + ldpp_dout(this, 0) << "zone " << szone << " does not exist" << dendl; + return -EINVAL; + } sources.emplace_back(&sync_env, szone, conn, pipe.source.get_bucket_info(), pipe.target.get_bucket(), - pipe.handler); + pipe.handler, z->name); } return 0; diff --git a/src/rgw/rgw_data_sync.h b/src/rgw/rgw_data_sync.h index 9fcebbbd17b..dde6133770a 100644 --- a/src/rgw/rgw_data_sync.h +++ b/src/rgw/rgw_data_sync.h @@ -703,11 +703,14 @@ class RGWBucketPipeSyncStatusManager : public DoutPrefixProvider { RGWBucketInfo info; rgw_bucket dest; RGWBucketSyncFlowManager::pipe_handler handler; + std::string zone_name; source(RGWDataSyncEnv* env, const rgw_zone_id& zone, RGWRESTConn* conn, const RGWBucketInfo& info, const rgw_bucket& dest, - const RGWBucketSyncFlowManager::pipe_handler& handler) - : sc(env, conn, zone), info(info), dest(dest), handler(handler) {} + const RGWBucketSyncFlowManager::pipe_handler& handler, + const std::string& zone_name) + : sc(env, conn, zone), info(info), dest(dest), handler(handler), + zone_name(zone_name) {} }; std::vector sources; -- 2.39.5