From: Sage Weil Date: Mon, 3 Oct 2016 14:17:00 +0000 (-0400) Subject: mon/OSDMonitor: clear old_weight when using it to auto mark-in X-Git-Tag: v11.1.0~334^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=877fb294d404f8a9fd8b8684967f184d2baa2a89;p=ceph.git mon/OSDMonitor: clear old_weight when using it to auto mark-in We store an old weight when we (auto) mark down. Clear that weight when we auto-mark in. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 9ba604cc1b22..b934bc587d7f 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -2181,20 +2181,6 @@ bool OSDMonitor::prepare_boot(MonOpRequestRef op) if (!m->hb_front_addr.is_blank_ip()) pending_inc.new_hb_front_up[from] = m->hb_front_addr; - // mark in? - if ((g_conf->mon_osd_auto_mark_auto_out_in && (oldstate & CEPH_OSD_AUTOOUT)) || - (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; - else - pending_inc.new_weight[from] = CEPH_OSD_IN; - } else { - dout(7) << "prepare_boot NOIN set, will not mark in " << m->get_orig_source_addr() << dendl; - } - } - down_pending_out.erase(from); // if any if (m->sb.weight) @@ -2265,6 +2251,24 @@ bool OSDMonitor::prepare_boot(MonOpRequestRef op) else xi.features = m->get_connection()->get_features(); + // mark in? + if ((g_conf->mon_osd_auto_mark_auto_out_in && + (oldstate & CEPH_OSD_AUTOOUT)) || + (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; + xi.old_weight = 0; + } else { + pending_inc.new_weight[from] = CEPH_OSD_IN; + } + } else { + dout(7) << "prepare_boot NOIN set, will not mark in " + << m->get_orig_source_addr() << dendl; + } + } + pending_inc.new_xinfo[from] = xi; // wait