mirror of
https://github.com/ceph/ceph
synced 2025-02-01 07:52:57 +00:00
Merge pull request #32341 from dillaman/wip-43379
rbd-mirror: do not auto-create peers in non-default namespaces Reviewed-by: Mykola Golub <mgolub@suse.com>
This commit is contained in:
commit
762e714692
@ -313,8 +313,11 @@ int execute_status(const po::variables_map &vm,
|
||||
return r;
|
||||
}
|
||||
|
||||
librados::IoCtx default_ns_io_ctx;
|
||||
default_ns_io_ctx.dup(io_ctx);
|
||||
default_ns_io_ctx.set_namespace("");
|
||||
std::vector<librbd::mirror_peer_site_t> mirror_peers;
|
||||
utils::get_mirror_peer_sites(io_ctx, &mirror_peers);
|
||||
utils::get_mirror_peer_sites(default_ns_io_ctx, &mirror_peers);
|
||||
|
||||
std::map<std::string, std::string> peer_fsid_to_name;
|
||||
utils::get_mirror_peer_fsid_to_names(mirror_peers, &peer_fsid_to_name);
|
||||
|
@ -1542,8 +1542,11 @@ int execute_status(const po::variables_map &vm,
|
||||
}
|
||||
|
||||
// dump per-image status
|
||||
librados::IoCtx default_ns_io_ctx;
|
||||
default_ns_io_ctx.dup(io_ctx);
|
||||
default_ns_io_ctx.set_namespace("");
|
||||
std::vector<librbd::mirror_peer_site_t> mirror_peers;
|
||||
utils::get_mirror_peer_sites(io_ctx, &mirror_peers);
|
||||
utils::get_mirror_peer_sites(default_ns_io_ctx, &mirror_peers);
|
||||
|
||||
std::map<std::string, std::string> peer_fsid_to_name;
|
||||
utils::get_mirror_peer_fsid_to_names(mirror_peers, &peer_fsid_to_name);
|
||||
|
@ -43,6 +43,7 @@ NamespaceReplayer<I>::NamespaceReplayer(
|
||||
Throttler<I> *image_sync_throttler, Throttler<I> *image_deletion_throttler,
|
||||
ServiceDaemon<I> *service_daemon,
|
||||
journal::CacheManagerHandler *cache_manager_handler) :
|
||||
m_namespace_name(name),
|
||||
m_local_mirror_uuid(local_mirror_uuid),
|
||||
m_remote_mirror_uuid(remote_mirror_uuid),
|
||||
m_local_site_name(local_site_name),
|
||||
@ -297,6 +298,11 @@ void NamespaceReplayer<I>::init_remote_status_updater() {
|
||||
ceph_assert(ceph_mutex_is_locked(m_lock));
|
||||
ceph_assert(!m_remote_status_updater);
|
||||
|
||||
std::string local_site_name;
|
||||
if (m_namespace_name.empty()) {
|
||||
local_site_name = m_local_site_name;
|
||||
}
|
||||
|
||||
librados::Rados rados(m_local_io_ctx);
|
||||
std::string local_fsid;
|
||||
int r = rados.cluster_fsid(&local_fsid);
|
||||
@ -308,7 +314,7 @@ void NamespaceReplayer<I>::init_remote_status_updater() {
|
||||
}
|
||||
|
||||
m_remote_status_updater.reset(MirrorStatusUpdater<I>::create(
|
||||
m_remote_io_ctx, m_threads, m_local_site_name, local_fsid));
|
||||
m_remote_io_ctx, m_threads, local_site_name, local_fsid));
|
||||
auto ctx = create_context_callback<
|
||||
NamespaceReplayer<I>,
|
||||
&NamespaceReplayer<I>::handle_init_remote_status_updater>(this);
|
||||
|
@ -260,6 +260,7 @@ private:
|
||||
const std::string &instance_id,
|
||||
Context* on_finish);
|
||||
|
||||
std::string m_namespace_name;
|
||||
librados::IoCtx m_local_io_ctx;
|
||||
librados::IoCtx m_remote_io_ctx;
|
||||
std::string m_local_mirror_uuid;
|
||||
|
Loading…
Reference in New Issue
Block a user