From: Sage Weil Date: Fri, 14 Feb 2014 19:13:26 +0000 (-0800) Subject: mon: only learn peer addresses when monmap == 0 X-Git-Tag: v0.67.8~34^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a3e57b7231cb28c2e0a896f747537ebdbe3a4e96;p=ceph.git mon: only learn peer addresses when monmap == 0 It is only safe to dynamically update the address for a peer mon in our monmap if we are in the midst of the initial quorum formation (i.e., monmap.epoch == 0). If it is a later epoch, we have formed our initial quorum and any and all monmap changes need to be agreed upon by the quorum and committed via paxos. Fixes: #7212 Signed-off-by: Sage Weil (cherry picked from commit 7bd2104acfeff0c9aa5e648d82ed372f901f767f) (cherry picked from commit 1996fd89fb3165a63449b135e05841579695aabd) --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 119ca4b07615..2f94837e23f7 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -1338,15 +1338,15 @@ void Monitor::handle_probe_reply(MMonProbe *m) } // new initial peer? - if (monmap->contains(m->name)) { - if (monmap->get_addr(m->name).is_blank_ip()) { - dout(1) << " learned initial mon " << m->name << " addr " << m->get_source_addr() << dendl; - monmap->set_addr(m->name, m->get_source_addr()); - m->put(); + if (monmap->get_epoch() == 0 && + monmap->contains(m->name) && + monmap->get_addr(m->name).is_blank_ip()) { + dout(1) << " learned initial mon " << m->name << " addr " << m->get_source_addr() << dendl; + monmap->set_addr(m->name, m->get_source_addr()); + m->put(); - bootstrap(); - return; - } + bootstrap(); + return; } // end discover phase