From 9b91adc560c8dffc1f5f7470d28c25f448b2b619 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 4 Aug 2015 13:21:50 -0400 Subject: [PATCH] mon: disallow post-hammer OSDs if there are up pre-hammer OSDs Force *all* OSDs to upgrade to hammer before allowing post-hammer OSDs to join. This prevents any pre-hammer OSDs from running at the same time as a post-hammer OSD. This commit, as well as the definition of the sentinal post-hammer feature, should get backported to hammer stable series. Backport: hammer Signed-off-by: Sage Weil (cherry picked from commit e38d60e94503c7e8511a60a8dceceb3cd39c2bd8) # Conflicts: # src/mon/OSDMonitor.cc --- src/mon/OSDMonitor.cc | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 730702e7ca83..ce5535878d97 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -1614,7 +1614,27 @@ bool OSDMonitor::preprocess_boot(MOSDBoot *m) << " doesn't announce support -- ignore" << dendl; goto ignore; } - + + // make sure upgrades stop at hammer + // * OSD_PROXY_FEATURES is the last pre-hammer feature + // * MON_METADATA is the first post-hammer feature + if (osdmap.get_num_up_osds() > 0) { + if ((m->osd_features & CEPH_FEATURE_MON_METADATA) && + !(osdmap.get_up_osd_features() & CEPH_FEATURE_OSD_PROXY_FEATURES)) { + mon->clog->info() << "disallowing boot of post-hammer OSD " + << m->get_orig_source_inst() + << " because one or more up OSDs is pre-hammer\n"; + goto ignore; + } + if (!(m->osd_features & CEPH_FEATURE_OSD_PROXY_FEATURES) && + (osdmap.get_up_osd_features() & CEPH_FEATURE_MON_METADATA)) { + mon->clog->info() << "disallowing boot of pre-hammer OSD " + << m->get_orig_source_inst() + << " because all up OSDs are post-hammer\n"; + goto ignore; + } + } + // already booted? if (osdmap.is_up(from) && osdmap.get_inst(from) == m->get_orig_source_inst()) { -- 2.47.3