From: Patrick Donnelly Date: Tue, 16 Mar 2021 02:40:51 +0000 (-0700) Subject: mon: fail standby-replay daemons when flag is turned off X-Git-Tag: v16.2.0~28^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d6e6127834a9dec76f07115ef1113c286b4dfbec;p=ceph.git mon: fail standby-replay daemons when flag is turned off This will simplify upgrade procedures. Fixes: https://tracker.ceph.com/issues/49719 Signed-off-by: Patrick Donnelly (cherry picked from commit 131e8841a32dde2b692e13ac31d9d3bab6cdd4a4) --- diff --git a/src/mon/FSCommands.cc b/src/mon/FSCommands.cc index a401cc786588..7ea738291063 100644 --- a/src/mon/FSCommands.cc +++ b/src/mon/FSCommands.cc @@ -607,6 +607,27 @@ public: return r; } + if (!allow) { + if (!mon->osdmon()->is_writeable()) { + // not allowed to write yet, so retry when we can + mon->osdmon()->wait_for_writeable(op, new PaxosService::C_RetryMessage(mon->mdsmon(), op)); + return -EAGAIN; + } + std::vector to_fail; + for (const auto& [gid, info]: fs->mds_map.get_mds_info()) { + if (info.state == MDSMap::STATE_STANDBY_REPLAY) { + to_fail.push_back(gid); + } + } + + for (const auto& gid : to_fail) { + mon->mdsmon()->fail_mds_gid(fsmap, gid); + } + if (!to_fail.empty()) { + mon->osdmon()->propose_pending(); + } + } + auto f = [allow](auto& fs) { if (allow) { fs->mds_map.set_standby_replay_allowed();