From: Adam C. Emerson Date: Thu, 30 Jun 2022 17:48:04 +0000 (-0400) Subject: rgw: RGWBucketPipeSyncStatusManager gets zone name on construction X-Git-Tag: v18.0.0~460^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b3d54c811548ab65078a3fa81d4ac4ab61377993;p=ceph.git 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 --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 2662a9ab0751..fe420de82d57 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 9fcebbbd17b8..dde6133770a3 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;