]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: cluster watcher should ensure it has latest OSD map 19550/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 15 Dec 2017 19:51:46 +0000 (14:51 -0500)
committerJason Dillaman <dillaman@redhat.com>
Fri, 15 Dec 2017 19:51:46 +0000 (14:51 -0500)
Fixes: http://tracker.ceph.com/issues/22461
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/tools/rbd_mirror/ClusterWatcher.cc

index c4f354419defaa6d521ee4722abf18d740e01634..2924cbef174bf1f2fa4ae69fa37b595f72a5ec0f 100644 (file)
@@ -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<pair<int64_t, string> > 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;