]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds/FSMap: do not assert allow_standby_replay on old FSMaps 43508/head
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 12 Oct 2021 18:39:42 +0000 (14:39 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Tue, 12 Oct 2021 18:39:42 +0000 (14:39 -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>
src/mds/FSMap.cc
src/mds/FSMap.h
src/mon/MDSMonitor.cc

index d82f8c439cc57a1841e61d5835f917e0b861ea2b..1c9d3f52bccdc05b07500b33023e17c6f38187a3 100644 (file)
@@ -850,8 +850,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);
   }
@@ -868,7 +872,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 62fa0a414f934a2b0bd70f0505e424e69d313708..197d5141c17d520c3f1449bd7dbd46917f427cb4 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 c3a3d0046e4a07f4c2b19c9ab7810e12a94bb12e..7818e4258c6bcf75ceff4bce484b90a3652b1bd8 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