From: Sage Weil Date: Wed, 16 May 2012 22:37:34 +0000 (-0700) Subject: mon: fix mon removal check X-Git-Tag: v0.47~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=515649558d5edebfd705e63bc34cd74d2db1f682;p=ceph.git mon: fix mon removal check Only take our absence from the monmap to mean that we were removed if we were ever a member in the first places. This fixes the bootstrap case: - create temp_monmap with existing member(s) plus new guy - ceph-mon --mkfs --monmap temp_monmap --fsid ... - start ceph-mon Basically, this is just using the seed monmap as a way to tell the new daemon which ip:port to use. Specifying mon addr, public network, or public addr would also work. Fixes: #2436 Signed-off-by: Sage Weil --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 91f65dab3968a..4e2deaf774908 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -400,8 +400,11 @@ void Monitor::bootstrap() // note my rank int newrank = monmap->get_rank(messenger->get_myaddr()); if (newrank < 0 && rank >= 0) { - dout(0) << " removed from monmap, suicide." << dendl; - exit(0); + // was i ever part of the quorum? + if (store->exists_bl_ss("joined")) { + dout(0) << " removed from monmap, suicide." << dendl; + exit(0); + } } if (newrank != rank) { dout(0) << " my rank is now " << newrank << " (was " << rank << ")" << dendl; @@ -851,6 +854,9 @@ void Monitor::finish_election() resend_routed_requests(); update_logger(); register_cluster_logger(); + + // make note of the fact that i was, once, part of the quorum. + store->put_int(1, "joined"); }