From b2c40cc07faa3751e28e946bc10d9700621db140 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Thu, 21 Jul 2022 16:34:05 -0400 Subject: [PATCH] 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 --- src/mon/MDSMonitor.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc index b2fcd4052df..2e97f8ff21f 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 && -- 2.39.5