From: Sage Weil Date: Sun, 11 May 2014 20:46:17 +0000 (-0700) Subject: mon: restore previous weight when auto-marked out osd boots X-Git-Tag: v0.82~43^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d9fff40d75bea7ba5c44344fe68ae8fef57b9f30;p=ceph.git mon: restore previous weight when auto-marked out osd boots When an OSD that was marked out boots, restore the weight it had before. Signed-off-by: Sage Weil --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 94fbabec2dfb..1461ff314970 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1285,7 +1285,10 @@ bool OSDMonitor::prepare_boot(MOSDBoot *m) (g_conf->mon_osd_auto_mark_new_in && (oldstate & CEPH_OSD_NEW)) || (g_conf->mon_osd_auto_mark_in)) { if (can_mark_in(from)) { - pending_inc.new_weight[from] = CEPH_OSD_IN; + 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; }