]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-mirror: cluster watcher should ensure it has latest OSD map 19644/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 15 Dec 2017 19:51:46 +0000 (14:51 -0500)
committerPrashant D <pdhange@redhat.com>
Fri, 22 Dec 2017 03:10:11 +0000 (22:10 -0500)
Fixes: http://tracker.ceph.com/issues/22461
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 9eb247961ae8bfe63c4025032ad532b7c3e3a1e7)

src/tools/rbd_mirror/ClusterWatcher.cc

index 516e1e3deef91bde16774d421171551c635e4d38..0aaba1fa5f237ae579e6c41d4611a30a59275680 100644 (file)
@@ -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<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;