From: Jason Dillaman Date: Fri, 15 Dec 2017 19:51:46 +0000 (-0500) Subject: rbd-mirror: cluster watcher should ensure it has latest OSD map X-Git-Tag: v13.0.2~755^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9eb247961ae8bfe63c4025032ad532b7c3e3a1e7;p=ceph.git rbd-mirror: cluster watcher should ensure it has latest OSD map Fixes: http://tracker.ceph.com/issues/22461 Signed-off-by: Jason Dillaman --- diff --git a/src/tools/rbd_mirror/ClusterWatcher.cc b/src/tools/rbd_mirror/ClusterWatcher.cc index c4f354419def..2924cbef174b 100644 --- a/src/tools/rbd_mirror/ClusterWatcher.cc +++ b/src/tools/rbd_mirror/ClusterWatcher.cc @@ -57,8 +57,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;