]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: enable persistent monmap features on full quorum
authorJoao Eduardo Luis <joao@suse.de>
Mon, 13 Feb 2017 00:36:31 +0000 (00:36 +0000)
committerJoao Eduardo Luis <joao@suse.de>
Thu, 2 Mar 2017 17:32:34 +0000 (17:32 +0000)
We will now only enable persistent features automatically
when ALL the monitors in the monmap are in the quorum.
 #noMonitorLeftBehind

Signed-off-by: Joao Eduardo Luis <joao@suse.de>
src/mon/MonmapMonitor.cc

index 5e18dba75727534e3ebc5e617e3374851357e47e..d71810b71bfe47ba89465c36ed0ba2996628b1b2 100644 (file)
@@ -129,6 +129,9 @@ void MonmapMonitor::apply_mon_features(const mon_feature_t& features)
 
   assert(is_writeable());
   assert(features.contains_all(pending_map.persistent_features));
+  // we should never hit this because `features` should be the result
+  // of the quorum's supported features. But if it happens, die.
+  assert(ceph::features::mon::get_supported().contains_all(features));
 
   mon_feature_t new_features =
     (pending_map.persistent_features ^
@@ -140,6 +143,16 @@ void MonmapMonitor::apply_mon_features(const mon_feature_t& features)
     return;
   }
 
+  if (mon->get_quorum().size() < mon->monmap->size()) {
+    dout(1) << __func__ << " new features " << new_features
+      << " contains features that require a full quorum"
+      << " (quorum size is " << mon->get_quorum().size()
+      << ", requires " << mon->monmap->size() << "): "
+      << new_features
+      << " -- do not enable them!" << dendl;
+    return;
+  }
+
   new_features |= pending_map.persistent_features;
 
   dout(5) << __func__ << " applying new features to monmap;"