From caa0aefca7bc819aa2e5136bdb705039996525fe Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Fri, 15 Dec 2017 14:51:46 -0500 Subject: [PATCH] rbd-mirror: cluster watcher should ensure it has latest OSD map Fixes: http://tracker.ceph.com/issues/22461 Signed-off-by: Jason Dillaman (cherry picked from commit 9eb247961ae8bfe63c4025032ad532b7c3e3a1e7) --- src/tools/rbd_mirror/ClusterWatcher.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tools/rbd_mirror/ClusterWatcher.cc b/src/tools/rbd_mirror/ClusterWatcher.cc index 516e1e3deef91..0aaba1fa5f237 100644 --- a/src/tools/rbd_mirror/ClusterWatcher.cc +++ b/src/tools/rbd_mirror/ClusterWatcher.cc @@ -62,8 +62,14 @@ void ClusterWatcher::refresh_pools() void ClusterWatcher::read_pool_peers(PoolPeers *pool_peers, PoolNames *pool_names) { + int r = m_cluster->wait_for_latest_osdmap(); + if (r < 0) { + derr << "error waiting for OSD map: " << cpp_strerror(r) << dendl; + return; + } + list > pools; - int r = m_cluster->pool_list2(pools); + r = m_cluster->pool_list2(pools); if (r < 0) { derr << "error listing pools: " << cpp_strerror(r) << dendl; return; -- 2.39.5