]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: disallow post-hammer OSDs if there are up pre-hammer OSDs 5471/head
authorSage Weil <sage@redhat.com>
Tue, 4 Aug 2015 17:21:50 +0000 (13:21 -0400)
committerSage Weil <sage@redhat.com>
Tue, 4 Aug 2015 17:21:50 +0000 (13:21 -0400)
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 <sage@redhat.com>
(cherry picked from commit e38d60e94503c7e8511a60a8dceceb3cd39c2bd8)

# Conflicts:
# src/mon/OSDMonitor.cc

src/mon/OSDMonitor.cc

index 730702e7ca83b544e4223fe5e41b0adbe6cc0c39..ce5535878d9735a566a004c3c94be492b54ab896 100644 (file)
@@ -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()) {