]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/OSDMonitor: do not clobber pending xinfo during boot 29221/head
authorSage Weil <sage@redhat.com>
Tue, 9 Jul 2019 18:54:33 +0000 (13:54 -0500)
committerSage Weil <sage@redhat.com>
Thu, 25 Jul 2019 20:55:35 +0000 (15:55 -0500)
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 <sage@redhat.com>
src/mon/OSDMonitor.cc

index 973a6e06ec1a2358e14861a5801d6bc3a907f1be..018561e53aa62368c4e8f6eebf71f9f58bb735f1 100644 (file)
@@ -3202,7 +3202,9 @@ bool OSDMonitor::prepare_boot(MonOpRequestRef op)
        pair<epoch_t,epoch_t>(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));
   }