]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
monclient: fix weirdness when we explicitly start with non-master mon
authorSage Weil <sage.weil@dreamhost.com>
Fri, 11 Feb 2011 20:53:49 +0000 (12:53 -0800)
committerSage Weil <sage.weil@dreamhost.com>
Fri, 11 Feb 2011 20:55:38 +0000 (12:55 -0800)
Fix

$ ./ceph -m 10.0.1.252:6790 health
2011-02-11 12:30:38.132728 mon <- [health]
2011-02-11 12:30:38.133243 mon <- [health]
2011-02-11 12:30:38.133697 mon0 -> 'Access denied' (-13)

when the IP we specify is, e.g., for mon.b.

Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
src/mon/MonClient.cc

index e3211c04a9e8b4bb6c10897915a9e05dea00e86b..77eceebb9a487a9f0f92ba908d6f50f5db1b11a1 100644 (file)
@@ -260,9 +260,11 @@ void MonClient::handle_monmap(MMonMap *m)
   map_cond.Signal();
   want_monmap = false;
 
-  if (!cur_mon.empty() && monmap.get_rank(cur_mon) < 0) {
-    dout(10) << "mon." << cur_mon << " went away" << dendl;
-    cur_mon.clear();
+  if (!cur_mon.empty()) {
+    if (!monmap.get_addr_name(cur_mon_addr, cur_mon)) {
+      dout(10) << "mon." << cur_mon << " went away" << dendl;
+      cur_mon.clear();
+    }
   }
 
   if (cur_mon.empty())