X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=ceph%2Fsrc%2Ftools%2Frbd_mirror%2FPoolReplayer.cc;h=ac3463256704a9f95fa67ac953b53fb9a5823f8d;hb=92f5a8d42d07f9929ae4fa7e01342fe8d96808a8;hp=7c450379f64859858e9848677824b0a10e703e80;hpb=a0324939f9d0e1905d5df8f57442f09dc70af83d;p=ceph.git diff --git a/ceph/src/tools/rbd_mirror/PoolReplayer.cc b/ceph/src/tools/rbd_mirror/PoolReplayer.cc index 7c450379f..ac3463256 100644 --- a/ceph/src/tools/rbd_mirror/PoolReplayer.cc +++ b/ceph/src/tools/rbd_mirror/PoolReplayer.cc @@ -272,6 +272,8 @@ bool PoolReplayer::is_running() const { template void PoolReplayer::init() { + Mutex::Locker l(m_lock); + ceph_assert(!m_pool_replayer_thread.is_started()); // reset state @@ -414,8 +416,6 @@ int PoolReplayer::init_rados(const std::string &cluster_name, const std::string &description, RadosRef *rados_ref, bool strip_cluster_overrides) { - rados_ref->reset(new librados::Rados()); - // NOTE: manually bootstrap a CephContext here instead of via // the librados API to avoid mixing global singletons between // the librados shared library and the daemon @@ -518,6 +518,8 @@ int PoolReplayer::init_rados(const std::string &cluster_name, cct->_conf.apply_changes(nullptr); cct->_conf.complain_about_parse_errors(cct); + rados_ref->reset(new librados::Rados()); + r = (*rados_ref)->init_with_context(cct); ceph_assert(r == 0); cct->put(); @@ -564,6 +566,19 @@ void PoolReplayer::run() m_instance_replayer->stop(); } +template +void PoolReplayer::reopen_logs() +{ + Mutex::Locker l(m_lock); + + if (m_local_rados) { + reinterpret_cast(m_local_rados->cct())->reopen_logs(); + } + if (m_remote_rados) { + reinterpret_cast(m_remote_rados->cct())->reopen_logs(); + } +} + template void PoolReplayer::print_status(Formatter *f, stringstream *ss) {