From: Joao Eduardo Luis Date: Mon, 13 Feb 2017 00:36:31 +0000 (+0000) Subject: mon: enable persistent monmap features on full quorum X-Git-Tag: v12.0.1~170^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=11c4946b636740bf4b44c77bd5bcc81c43d462e3;p=ceph.git 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 --- 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;"