]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fail standby-replay daemons when flag is turned off
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 16 Mar 2021 02:40:51 +0000 (19:40 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 23 Mar 2021 03:09:41 +0000 (20:09 -0700)
This will simplify upgrade procedures.

Fixes: https://tracker.ceph.com/issues/49719
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 131e8841a32dde2b692e13ac31d9d3bab6cdd4a4)

src/mon/FSCommands.cc

index a401cc786588c7d512848546cfab6f852bda4b0c..7ea738291063d0caa554385585e50c2d2e6f7e49 100644 (file)
@@ -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<mds_gid_t> 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();