From: Sage Weil Date: Tue, 4 Aug 2015 17:21:50 +0000 (-0400) Subject: mon: disallow post-hammer OSDs if there are up pre-hammer OSDs X-Git-Tag: v0.94.4~83^2^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F5471%2Fhead;p=ceph.git 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 --- 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()) {