]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/tools/rbd_mirror/ClusterWatcher.cc
update sources to v12.2.3
[ceph.git] / ceph / 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;