]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: config setting to skip FSMap::sanity
authorJohn Spray <john.spray@redhat.com>
Wed, 16 Mar 2016 12:49:51 +0000 (12:49 +0000)
committerJohn Spray <john.spray@redhat.com>
Wed, 16 Mar 2016 13:07:22 +0000 (13:07 +0000)
Only for use in extremis, where we have encountered
a bug that generates an invalid FSMap, but the way
to resolve it might be to proceed anyway and stay
up long enough to use commands to fix it.

Fixes: #15063
Signed-off-by: John Spray <john.spray@redhat.com>
src/common/config_opts.h
src/mon/MDSMonitor.cc

index 26c7b13a36c871387ef0dee3dce88e3ca8762ea2..f3124e48816200d1455b95c9b55604b7d0500b22 100644 (file)
@@ -312,6 +312,7 @@ OPTION(mon_osd_min_down_reporters, OPT_INT, 2)   // number of OSDs from differen
 OPTION(mon_osd_reporter_subtree_level , OPT_STR, "host")   // in which level of parent bucket the reporters are counted
 OPTION(mon_osd_force_trim_to, OPT_INT, 0)   // force mon to trim maps to this point, regardless of min_last_epoch_clean (dangerous, use with care)
 OPTION(mon_mds_force_trim_to, OPT_INT, 0)   // force mon to trim mdsmaps to this point (dangerous, use with care)
+OPTION(mon_mds_skip_sanity, OPT_BOOL, false)  // skip safety assertions on FSMap (in case of bugs where we want to continue anyway)
 
 // monitor debug options
 OPTION(mon_debug_deprecated_as_obsolete, OPT_BOOL, false) // consider deprecated commands as obsolete
index fc5e2b17b4a5026c00d2986ac10ea19fba59f6bd..3a07a4d5b8c6eca4a9c5b692d0c97adf8bdce593 100644 (file)
@@ -144,7 +144,9 @@ void MDSMonitor::update_from_paxos(bool *need_bootstrap)
   // new map
   dout(4) << "new map" << dendl;
   print_map(fsmap, 0);
-  fsmap.sanity();
+  if (!g_conf->mon_mds_skip_sanity) {
+    fsmap.sanity();
+  }
 
   check_subs();
   update_logger();
@@ -170,7 +172,9 @@ void MDSMonitor::encode_pending(MonitorDBStore::TransactionRef t)
 
   // print map iff 'debug mon = 30' or higher
   print_map(pending_fsmap, 30);
-  pending_fsmap.sanity();
+  if (!g_conf->mon_mds_skip_sanity) {
+    pending_fsmap.sanity();
+  }
 
   // Set 'modified' on maps modified this epoch
   for (auto &i : fsmap.filesystems) {