]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/FSMap: do not assert allow_standby_replay on old FSMaps 43614/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 12 Oct 2021 18:39:42 +0000 (14:39 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 21 Oct 2021 02:31:27 +0000 (22:31 -0400)
Octopus and older may have standby-replay daemons with
allow_standby_replay==false.

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

src/mds/FSMap.cc
src/mds/FSMap.h
src/mon/MDSMonitor.cc

index 9508e8df2c9ea4934da906ca422c661781c90a96..a8d95d8cab2e5f4592978e162cef7d469022c87d 100644 (file)
@@ -840,8 +840,12 @@ const MDSMap::mds_info_t* FSMap::find_replacement_for(mds_role_t role) const
   return get_available_standby(*fs);
 }
 
-void FSMap::sanity() const
+void FSMap::sanity(bool pending) const
 {
+  /* Only do some sanity checks on **new** FSMaps. Older versions may not be
+   * compliant.
+   */
+
   if (legacy_client_fscid != FS_CLUSTER_ID_NONE) {
     ceph_assert(filesystems.count(legacy_client_fscid) == 1);
   }
@@ -858,7 +862,7 @@ void FSMap::sanity() const
         ceph_assert(fs->mds_map.failed.count(info.rank) == 0);
         ceph_assert(fs->mds_map.damaged.count(info.rank) == 0);
       } else {
-        ceph_assert(fs->mds_map.allows_standby_replay());
+        ceph_assert(!pending || fs->mds_map.allows_standby_replay());
       }
       ceph_assert(info.compat.writeable(fs->mds_map.compat));
     }
index 9fc488b86c25132dc2dc641bb8a8d55a37bc7072..037c8246b3ab2116125b746df3faf26063694fcd 100644 (file)
@@ -568,7 +568,7 @@ public:
    * Assert that the FSMap, Filesystem, MDSMap, mds_info_t relations are
    * all self-consistent.
    */
-  void sanity() const;
+  void sanity(bool pending=false) const;
 
   void encode(ceph::buffer::list& bl, uint64_t features) const;
   void decode(ceph::buffer::list::const_iterator& p);
index 419447befa42ffc81db616dd6f1f6d68c9e8d3bd..9b4c73c9fc4de86e7ca8d8e9afd2953c6eb43fd8 100644 (file)
@@ -190,7 +190,7 @@ void MDSMonitor::encode_pending(MonitorDBStore::TransactionRef t)
   // print map iff 'debug mon = 30' or higher
   print_map<30>(pending);
   if (!g_conf()->mon_mds_skip_sanity) {
-    pending.sanity();
+    pending.sanity(true);
   }
 
   // Set 'modified' on maps modified this epoch