From 3920ce308a07f5b393c3fe9263a273c10069e1e1 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 17 May 2012 18:14:33 -0700 Subject: [PATCH] mon: add -or- update blank mon addr with join command Update blank addrs with the join command (in addition to adding new mons). Signed-off-by: Sage Weil --- src/mon/MonmapMonitor.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc index 34669cbaec00d..664356e12b41a 100644 --- a/src/mon/MonmapMonitor.cc +++ b/src/mon/MonmapMonitor.cc @@ -336,7 +336,7 @@ bool MonmapMonitor::preprocess_join(MMonJoin *join) { dout(10) << "preprocess_join " << join->name << " at " << join->addr << dendl; - if (pending_map.contains(join->name)) { + if (pending_map.contains(join->name) && !pending_map.get_addr(join->name).is_blank_ip()) { dout(10) << " already have " << join->name << dendl; join->put(); return true; @@ -350,7 +350,9 @@ bool MonmapMonitor::preprocess_join(MMonJoin *join) } bool MonmapMonitor::prepare_join(MMonJoin *join) { - dout(0) << "adding " << join->name << " at " << join->addr << " to monitor cluster" << dendl; + dout(0) << "adding/updating " << join->name << " at " << join->addr << " to monitor cluster" << dendl; + if (pending_map.contains(join->name)) + pending_map.remove(join->name); pending_map.add(join->name, join->addr); pending_map.last_changed = ceph_clock_now(g_ceph_context); join->put(); -- 2.39.5