int ret = sync_env.conn->get_json_resource("/admin/log", pairs, *log_info);
if (ret < 0) {
- ldout(store->ctx(), 0) << "ERROR: failed to fetch datalog info" << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: failed to fetch datalog info" << dendl;
return ret;
}
- ldout(store->ctx(), 20) << "remote datalog, num_shards=" << log_info->num_shards << dendl;
+ ldpp_dout(dpp, 20) << "remote datalog, num_shards=" << log_info->num_shards << dendl;
return 0;
}
int ret = http_manager.start();
if (ret < 0) {
- ldout(store->ctx(), 0) << "failed in http_manager.start() ret=" << ret << dendl;
+ ldpp_dout(dpp, 0) << "failed in http_manager.start() ret=" << ret << dendl;
return ret;
}
RGWHTTPManager http_manager(store->ctx(), crs.get_completion_mgr());
int ret = http_manager.start();
if (ret < 0) {
- ldout(store->ctx(), 0) << "failed in http_manager.start() ret=" << ret << dendl;
+ ldpp_dout(dpp, 0) << "failed in http_manager.start() ret=" << ret << dendl;
return ret;
}
RGWDataSyncEnv sync_env_local = sync_env;
RGWHTTPManager http_manager(store->ctx(), crs.get_completion_mgr());
int ret = http_manager.start();
if (ret < 0) {
- ldout(store->ctx(), 0) << "failed in http_manager.start() ret=" << ret << dendl;
+ ldpp_dout(dpp, 0) << "failed in http_manager.start() ret=" << ret << dendl;
return ret;
}
RGWDataSyncEnv sync_env_local = sync_env;
RGWHTTPManager http_manager(store->ctx(), crs.get_completion_mgr());
int ret = http_manager.start();
if (ret < 0) {
- ldout(store->ctx(), 0) << "failed in http_manager.start() ret=" << ret << dendl;
+ ldpp_dout(dpp, 0) << "failed in http_manager.start() ret=" << ret << dendl;
return ret;
}
RGWDataSyncEnv sync_env_local = sync_env;
lock.unlock();
if (r < 0) {
- ldout(store->ctx(), 0) << "ERROR: failed to run sync" << dendl;
+ ldpp_dout(dpp, 0) << "ERROR: failed to run sync" << dendl;
return r;
}
return 0;
{
auto zone_def_iter = store->zone_by_id.find(source_zone);
if (zone_def_iter == store->zone_by_id.end()) {
- ldout(store->ctx(), 0) << "ERROR: failed to find zone config info for zone=" << source_zone << dendl;
+ ldpp_dout(this, 0) << "ERROR: failed to find zone config info for zone=" << source_zone << dendl;
return -EIO;
}
conn = store->get_zone_conn_by_id(source_zone);
if (!conn) {
- ldout(store->ctx(), 0) << "connection object to zone " << source_zone << " does not exist" << dendl;
+ ldpp_dout(this, 0) << "connection object to zone " << source_zone << " does not exist" << dendl;
return -EINVAL;
}
int r = source_log.init(source_zone, conn, error_logger, store->get_sync_tracer(), sync_module);
if (r < 0) {
- lderr(store->ctx()) << "ERROR: failed to init remote log, r=" << r << dendl;
+ ldpp_dout(this, 0) << "ERROR: failed to init remote log, r=" << r << dendl;
finalize();
return r;
}
rgw_datalog_info datalog_info;
r = source_log.read_log_info(&datalog_info);
if (r < 0) {
- ldout(store->ctx(), 5) << "ERROR: master.read_log_info() returned r=" << r << dendl;
+ ldpp_dout(this, 5) << "ERROR: master.read_log_info() returned r=" << r << dendl;
finalize();
return r;
}
error_logger = nullptr;
}
+unsigned RGWDataSyncStatusManager::get_subsys() const
+{
+ return dout_subsys;
+}
+
+std::ostream& RGWDataSyncStatusManager::gen_prefix(std::ostream& out) const
+{
+ auto zone = std::string_view{source_zone};
+ return out << "data sync zone:" << zone.substr(0, 8) << ' ';
+}
+
string RGWDataSyncStatusManager::sync_status_oid(const string& source_zone)
{
char buf[datalog_sync_status_oid_prefix.size() + source_zone.size() + 16];
RGWHTTPManager http_manager(store->ctx(), crs.get_completion_mgr());
int ret = http_manager.start();
if (ret < 0) {
- ldout(store->ctx(), 0) << "failed in http_manager.start() ret=" << ret << dendl;
+ ldpp_dout(dpp, 0) << "failed in http_manager.start() ret=" << ret << dendl;
return ret;
}
RGWDataSyncEnv sync_env_local = sync_env;
};
class RGWRemoteDataLog : public RGWCoroutinesManager {
+ const DoutPrefixProvider *dpp;
RGWRados *store;
RGWAsyncRadosProcessor *async_rados;
rgw::BucketChangeObserver *observer;
bool initialized;
public:
- RGWRemoteDataLog(RGWRados *_store, RGWAsyncRadosProcessor *async_rados,
+ RGWRemoteDataLog(const DoutPrefixProvider *dpp, RGWRados *_store,
+ RGWAsyncRadosProcessor *async_rados,
rgw::BucketChangeObserver *observer)
: RGWCoroutinesManager(_store->ctx(), _store->get_cr_registry()),
- store(_store), async_rados(async_rados), observer(observer),
+ dpp(dpp), store(_store), async_rados(async_rados), observer(observer),
http_manager(store->ctx(), completion_mgr),
lock("RGWRemoteDataLog::lock"), data_sync_cr(NULL),
initialized(false) {}
void wakeup(int shard_id, set<string>& keys);
};
-class RGWDataSyncStatusManager {
+class RGWDataSyncStatusManager : public DoutPrefixProvider {
RGWRados *store;
rgw_rados_ref ref;
rgw::BucketChangeObserver *observer = nullptr)
: store(_store), source_zone(_source_zone), conn(NULL), error_logger(NULL),
sync_module(nullptr),
- source_log(store, async_rados, observer), num_shards(0) {}
+ source_log(this, store, async_rados, observer), num_shards(0) {}
RGWDataSyncStatusManager(RGWRados *_store, RGWAsyncRadosProcessor *async_rados,
const string& _source_zone, const RGWSyncModuleInstanceRef& _sync_module,
rgw::BucketChangeObserver *observer = nullptr)
: store(_store), source_zone(_source_zone), conn(NULL), error_logger(NULL),
sync_module(_sync_module),
- source_log(store, async_rados, observer), num_shards(0) {}
+ source_log(this, store, async_rados, observer), num_shards(0) {}
~RGWDataSyncStatusManager() {
finalize();
}
void stop() {
source_log.finish();
}
+
+ // implements DoutPrefixProvider
+ CephContext *get_cct() const override { return store->ctx(); }
+ unsigned get_subsys() const override;
+ std::ostream& gen_prefix(std::ostream& out) const override;
};
class RGWBucketSyncStatusManager;