From: Patrick Donnelly Date: Thu, 21 Jul 2022 20:34:05 +0000 (-0400) Subject: mon/MDSMonitor: fix check for standby reversion X-Git-Tag: v18.0.0~424^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b2c40cc07faa3751e28e946bc10d9700621db140;p=ceph.git mon/MDSMonitor: fix check for standby reversion 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 --- diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index b2fcd4052df5..2e97f8ff21fd 100644 --- a/src/mon/MDSMonitor.cc +++ b/src/mon/MDSMonitor.cc @@ -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 &&