From 11c4946b636740bf4b44c77bd5bcc81c43d462e3 Mon Sep 17 00:00:00 2001 From: Joao Eduardo Luis Date: Mon, 13 Feb 2017 00:36:31 +0000 Subject: [PATCH] mon: enable persistent monmap features on full quorum 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 --- src/mon/MonmapMonitor.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/mon/MonmapMonitor.cc b/src/mon/MonmapMonitor.cc index 5e18dba7572..d71810b71bf 100644 --- a/src/mon/MonmapMonitor.cc +++ b/src/mon/MonmapMonitor.cc @@ -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;" -- 2.39.5