From ba6b01cd1bd6f23a69aa3275ca410ad096f1e2e1 Mon Sep 17 00:00:00 2001 From: Ali Maredia Date: Thu, 6 Sep 2018 00:29:47 -0400 Subject: [PATCH] rgw: MetaSyncStatusManager implements DoutPrefixProvider There are no member functions of RGWMetaSyncStatusManager with ldouts to replace with ldpp_dout. Signed-off-by: Ali Maredia --- src/rgw/rgw_sync.cc | 11 +++++++++++ src/rgw/rgw_sync.h | 17 +++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index 4af523c78d9dd..6943a5c054bc8 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -349,6 +349,16 @@ int RGWMetaSyncStatusManager::init() return 0; } +unsigned RGWMetaSyncStatusManager::get_subsys() const +{ + return dout_subsys; +} + +std::ostream& RGWMetaSyncStatusManager::gen_prefix(std::ostream& out) const +{ + return out << "meta sync: "; +} + void RGWMetaSyncEnv::init(CephContext *_cct, RGWRados *_store, RGWRESTConn *_conn, RGWAsyncRadosProcessor *_async_rados, RGWHTTPManager *_http_manager, RGWSyncErrorLogger *_error_logger, RGWSyncTraceManager *_sync_tracer) { @@ -1989,6 +1999,7 @@ public: }; void RGWRemoteMetaLog::init_sync_env(RGWMetaSyncEnv *env) { + env->dpp = dpp; env->cct = store->ctx(); env->store = store; env->conn = conn; diff --git a/src/rgw/rgw_sync.h b/src/rgw/rgw_sync.h index d43dcb20cf23c..f5fede9ae88db 100644 --- a/src/rgw/rgw_sync.h +++ b/src/rgw/rgw_sync.h @@ -167,6 +167,7 @@ public: }; struct RGWMetaSyncEnv { + const DoutPrefixProvider *dpp; CephContext *cct{nullptr}; RGWRados *store{nullptr}; RGWRESTConn *conn{nullptr}; @@ -186,6 +187,7 @@ struct RGWMetaSyncEnv { }; class RGWRemoteMetaLog : public RGWCoroutinesManager { + const DoutPrefixProvider *dpp; RGWRados *store; RGWRESTConn *conn; RGWAsyncRadosProcessor *async_rados; @@ -209,10 +211,11 @@ class RGWRemoteMetaLog : public RGWCoroutinesManager { RGWSyncTraceNodeRef tn; public: - RGWRemoteMetaLog(RGWRados *_store, RGWAsyncRadosProcessor *async_rados, + RGWRemoteMetaLog(DoutPrefixProvider *dpp, RGWRados *_store, + RGWAsyncRadosProcessor *async_rados, RGWMetaSyncStatusManager *_sm) : RGWCoroutinesManager(_store->ctx(), _store->get_cr_registry()), - store(_store), conn(NULL), async_rados(async_rados), + dpp(dpp), store(_store), conn(NULL), async_rados(async_rados), http_manager(store->ctx(), completion_mgr), status_manager(_sm) {} @@ -235,7 +238,7 @@ public: } }; -class RGWMetaSyncStatusManager { +class RGWMetaSyncStatusManager : public DoutPrefixProvider { RGWRados *store; librados::IoCtx ioctx; @@ -263,7 +266,7 @@ class RGWMetaSyncStatusManager { public: RGWMetaSyncStatusManager(RGWRados *_store, RGWAsyncRadosProcessor *async_rados) - : store(_store), master_log(store, async_rados, this), + : store(_store), master_log(this, store, async_rados, this), ts_to_shard_lock("ts_to_shard_lock") {} int init(); @@ -283,6 +286,12 @@ public: int run() { return master_log.run_sync(); } + + // implements DoutPrefixProvider + CephContext *get_cct() const override { return store->ctx(); } + unsigned get_subsys() const override; + std::ostream& gen_prefix(std::ostream& out) const override; + void wakeup(int shard_id) { return master_log.wakeup(shard_id); } void stop() { master_log.finish(); -- 2.39.5