]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: restore previous weight when auto-marked out osd boots 1813/head
authorSage Weil <sage@inktank.com>
Sun, 11 May 2014 20:46:17 +0000 (13:46 -0700)
committerSage Weil <sage@inktank.com>
Sun, 11 May 2014 20:46:17 +0000 (13:46 -0700)
When an OSD that was marked out boots, restore the weight it had before.

Signed-off-by: Sage Weil <sage@inktank.com>
src/mon/OSDMonitor.cc

index 94fbabec2dfbb4e978a398be192e653bb8e658db..1461ff31497036d04c284b0132089ad9b7eec422 100644 (file)
@@ -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;
       }