{
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 ret = http_manager.start();
if (ret < 0) {
- ldout(store->ctx(), 0) << "failed in http_manager.start() ret=" << ret << dendl;
+ ldpp_dout(this, 0) << "failed in http_manager.start() ret=" << ret << dendl;
return ret;
}
bucket_instance_meta_info result;
ret = cr_mgr.run(new RGWReadRESTResourceCR<bucket_instance_meta_info>(store->ctx(), conn, &http_manager, path, pairs, &result));
if (ret < 0) {
- ldout(store->ctx(), 0) << "ERROR: failed to fetch bucket metadata info from zone=" << source_zone << " path=" << path << " key=" << key << " ret=" << ret << dendl;
+ ldpp_dout(this, 0) << "ERROR: failed to fetch bucket metadata info from zone=" << source_zone << " path=" << path << " key=" << key << " ret=" << ret << dendl;
return ret;
}
auto async_rados = store->get_async_rados();
for (int i = 0; i < effective_num_shards; i++) {
- RGWRemoteBucketLog *l = new RGWRemoteBucketLog(store, this, async_rados, &http_manager);
+ RGWRemoteBucketLog *l = new RGWRemoteBucketLog(this, store, this, async_rados, &http_manager);
ret = l->init(source_zone, conn, bucket, (num_shards ? i : -1), error_logger, store->get_sync_tracer(), sync_module);
if (ret < 0) {
- ldout(store->ctx(), 0) << "ERROR: failed to initialize RGWRemoteBucketLog object" << dendl;
+ ldpp_dout(this, 0) << "ERROR: failed to initialize RGWRemoteBucketLog object" << dendl;
return ret;
}
source_logs[i] = l;
int ret = cr_mgr.run(stacks);
if (ret < 0) {
- ldout(store->ctx(), 0) << "ERROR: failed to read sync status for "
+ ldpp_dout(this, 0) << "ERROR: failed to read sync status for "
<< bucket_str{bucket} << dendl;
return ret;
}
int ret = cr_mgr.run(stacks);
if (ret < 0) {
- ldout(store->ctx(), 0) << "ERROR: failed to read sync status for "
+ ldpp_dout(this, 0) << "ERROR: failed to read sync status for "
<< bucket_str{bucket} << dendl;
return ret;
}
return 0;
}
+unsigned RGWBucketSyncStatusManager::get_subsys() const
+{
+ return dout_subsys;
+}
+
+std::ostream& RGWBucketSyncStatusManager::gen_prefix(std::ostream& out) const
+{
+ auto zone = std::string_view{source_zone};
+ return out << "bucket sync zone:" << zone.substr(0, 8)
+ << " bucket:" << bucket.name << ' ';
+}
+
string RGWBucketSyncStatusManager::status_oid(const string& source_zone,
const rgw_bucket_shard& bs)
{
class RGWRemoteBucketLog : public RGWCoroutinesManager {
+ const DoutPrefixProvider *dpp;
RGWRados *store;
RGWRESTConn *conn{nullptr};
string source_zone;
RGWBucketSyncCR *sync_cr{nullptr};
public:
- RGWRemoteBucketLog(RGWRados *_store, RGWBucketSyncStatusManager *_sm,
- RGWAsyncRadosProcessor *_async_rados, RGWHTTPManager *_http_manager) : RGWCoroutinesManager(_store->ctx(), _store->get_cr_registry()), store(_store),
- status_manager(_sm), async_rados(_async_rados), http_manager(_http_manager) {}
+ RGWRemoteBucketLog(const DoutPrefixProvider *dpp, RGWRados *_store,
+ RGWBucketSyncStatusManager *_sm,
+ RGWAsyncRadosProcessor *_async_rados,
+ RGWHTTPManager *_http_manager)
+ : RGWCoroutinesManager(_store->ctx(), _store->get_cr_registry()),
+ dpp(dpp), store(_store), status_manager(_sm),
+ async_rados(_async_rados), http_manager(_http_manager)
+ {}
int init(const string& _source_zone, RGWRESTConn *_conn,
const rgw_bucket& bucket, int shard_id,
void wakeup();
};
-class RGWBucketSyncStatusManager {
+class RGWBucketSyncStatusManager : public DoutPrefixProvider {
RGWRados *store;
RGWCoroutinesManager cr_mgr;
int read_sync_status();
int run();
+
+ // implements DoutPrefixProvider
+ CephContext *get_cct() const override { return store->ctx(); }
+ unsigned get_subsys() const override;
+ std::ostream& gen_prefix(std::ostream& out) const override;
};
/// read the sync status of all bucket shards from the given source zone