From 7f89617b64bf109fee89415fa881760d7bb32482 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 9 Jul 2019 13:54:33 -0500 Subject: [PATCH] mon/OSDMonitor: do not clobber pending xinfo during boot If we have a pending xinfo change and also process a boot message, we should not throw out the pending xinfo change. This triggers when you mark an osd down and it sends both a MOSDMarkMeDead and a new MOSDBoot message in quick succession: the first message sets dead_epoch but the boot message processing clobbers it. Signed-off-by: Sage Weil --- src/mon/OSDMonitor.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 973a6e06ec1a2..018561e53aa62 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -3202,7 +3202,9 @@ bool OSDMonitor::prepare_boot(MonOpRequestRef op) pair(begin, end); } - osd_xinfo_t xi = osdmap.get_xinfo(from); + if (pending_inc.new_xinfo.count(from) == 0) + pending_inc.new_xinfo[from] = osdmap.osd_xinfo[from]; + osd_xinfo_t& xi = pending_inc.new_xinfo[from]; if (m->boot_epoch == 0) { xi.laggy_probability *= (1.0 - g_conf()->mon_osd_laggy_weight); xi.laggy_interval *= (1.0 - g_conf()->mon_osd_laggy_weight); @@ -3237,8 +3239,8 @@ bool OSDMonitor::prepare_boot(MonOpRequestRef op) (g_conf()->mon_osd_auto_mark_new_in && (oldstate & CEPH_OSD_NEW)) || (g_conf()->mon_osd_auto_mark_in)) { if (can_mark_in(from)) { - if (osdmap.osd_xinfo[from].old_weight > 0) { - pending_inc.new_weight[from] = osdmap.osd_xinfo[from].old_weight; + if (xi.old_weight > 0) { + pending_inc.new_weight[from] = xi.old_weight; xi.old_weight = 0; } else { pending_inc.new_weight[from] = CEPH_OSD_IN; @@ -3249,8 +3251,6 @@ bool OSDMonitor::prepare_boot(MonOpRequestRef op) } } - pending_inc.new_xinfo[from] = xi; - // wait wait_for_finished_proposal(op, new C_Booted(this, op)); } -- 2.39.5