]> git.apps.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>
Tue, 22 Mar 2016 12:08:49 +0000 (12:08 +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 aea9c169b63a3abedada5d100c4a4d2c9b2eef3c..3862b669f54dbf0566a4ba293db97ee93aad2a86 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 7c37840da0ea85dbb1c148a6152fd1d0fb31391c..762abaa274543a9975e53f0a8162da0e0e06c64c 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) {