]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/MDSMonitor: fix check for standby reversion 47218/head
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 21 Jul 2022 20:34:05 +0000 (16:34 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 25 Jul 2022 13:57:15 +0000 (09:57 -0400)
A standby-replay daemon always has a rank, so this check is completely
wrong. If a beacon from a standby-replay daemon reaches
MDSMonitor::prepare_beacon, it will always be evicted/removed by the
mons. This is rare (usually a reply occurs directly from
MDSMonitor::preprocess_beacon) but can happen in certain circumstances,
like a health warning included in the beacon.

Fixes: https://tracker.ceph.com/issues/56666
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mon/MDSMonitor.cc

index b2fcd4052df52fdedafd42560a7fe97b10d5915d..2e97f8ff21fdc84fec41455025f770f77d314fe3 100644 (file)
@@ -707,12 +707,13 @@ bool MDSMonitor::prepare_beacon(MonOpRequestRef op)
       dout(10) << "mds_beacon mds can't activate itself (" << ceph_mds_state_name(info.state)
               << " -> " << ceph_mds_state_name(state) << ")" << dendl;
       goto evict;
-    } else if ((state == MDSMap::STATE_STANDBY || state == MDSMap::STATE_STANDBY_REPLAY)
-        && info.rank != MDS_RANK_NONE)
-    {
-      dout(4) << "mds_beacon MDS can't go back into standby after taking rank: "
+    } else if (info.state >= CEPH_MDS_STATE_REPLAY &&
+              (state == MDSMap::STATE_STANDBY ||
+               state == MDSMap::STATE_STANDBY_REPLAY)) {
+      dout(1) << "mds_beacon MDS can't go back into standby after taking rank: "
                  "held rank " << info.rank << " while requesting state "
-              << ceph_mds_state_name(state) << dendl;
+              << ceph_mds_state_name(state) << " from "
+              << ceph_mds_state_name(info.state) << dendl;
       goto evict;
     } else if (info.state == MDSMap::STATE_STOPPING &&
         state != MDSMap::STATE_STOPPING &&