From: Sage Weil Date: Mon, 21 May 2012 20:01:49 +0000 (-0700) Subject: mon: allow mons to rename themselves with the join message X-Git-Tag: v0.48argonaut~137^2~13^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ee138678d06482117515523bba33d19251c1d94c;p=ceph.git mon: allow mons to rename themselves with the join message This allows mons that got stuck in the initial quorum's monmap as noname-* to fix their name before joining in. Signed-off-by: Sage Weil --- diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc index c612ca64fcec..1b7dd2736d93 100644 --- a/src/mon/MonmapMonitor.cc +++ b/src/mon/MonmapMonitor.cc @@ -341,7 +341,7 @@ bool MonmapMonitor::preprocess_join(MMonJoin *join) join->put(); return true; } - if (pending_map.contains(join->addr)) { + if (pending_map.contains(join->addr) && pending_map.get_name(join->addr) == join->name) { dout(10) << " already have " << join->addr << dendl; join->put(); return true; @@ -353,6 +353,8 @@ bool MonmapMonitor::prepare_join(MMonJoin *join) dout(0) << "adding/updating " << join->name << " at " << join->addr << " to monitor cluster" << dendl; if (pending_map.contains(join->name)) pending_map.remove(join->name); + if (pending_map.contains(join->addr)) + pending_map.remove(pending_map.get_name(join->addr)); pending_map.add(join->name, join->addr); pending_map.last_changed = ceph_clock_now(g_ceph_context); join->put();