]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
OSDMonitor: add kraken feature bit
authorJosh Durgin <jdurgin@redhat.com>
Fri, 17 Jun 2016 00:29:56 +0000 (17:29 -0700)
committerJosh Durgin <jdurgin@redhat.com>
Sat, 9 Jul 2016 01:33:13 +0000 (18:33 -0700)
This is needed to turn on persisting write errors, since older OSDs
won't be able to handle them.

Other features for kraken could potentially use this as well.

Signed-off-by: Josh Durgin <jdurgin@redhat.com>
src/include/ceph_features.h
src/include/rados.h
src/mon/OSDMonitor.cc

index 9756746425ce70d8dd684f8c2a175e587ae1fe0f..710e9a4704a94656ee2315d857ead718efd17b02 100755 (executable)
@@ -24,7 +24,7 @@
 #define CEPH_FEATURE_PGPOOL3        (1ULL<<11)
 #define CEPH_FEATURE_OSDREPLYMUX    (1ULL<<12)
 #define CEPH_FEATURE_OSDENC         (1ULL<<13)
-// UNUSED: (1ULL<<14)
+#define CEPH_FEATURE_SERVER_KRAKEN  (1ULL<<14) // REUSED
 #define CEPH_FEATURE_MONENC         (1ULL<<15)
 #define DEPRECATED_CEPH_FEATURE_QUERY_T        (1ULL<<16) // DEPRECATED: JEWEL
 #define DEPRECATED_CEPH_FEATURE_INDEP_PG_MAP   (1ULL<<17) // DEPRECATED: JEWEL
@@ -179,6 +179,7 @@ static inline unsigned long long ceph_sanitize_features(unsigned long long f) {
         CEPH_FEATURE_CRUSH_TUNABLES5 |     \
         CEPH_FEATURE_SERVER_JEWEL |  \
         CEPH_FEATURE_FS_FILE_LAYOUT_V2 |                \
+        CEPH_FEATURE_SERVER_KRAKEN |   \
         0ULL)
 
 #define CEPH_FEATURES_SUPPORTED_DEFAULT  CEPH_FEATURES_ALL
index c0559029e056bfa9ef68988a04942f309210182b..66520ba5b22f6c4e9694a6b0d1f44aa294e6e5c2 100644 (file)
@@ -145,6 +145,7 @@ extern const char *ceph_osd_state_name(int s);
 #define CEPH_OSDMAP_NOREBALANCE (1<<14) /* block osd backfill unless pg is degraded */
 #define CEPH_OSDMAP_SORTBITWISE (1<<15) /* use bitwise hobject_t sort */
 #define CEPH_OSDMAP_REQUIRE_JEWEL (1<<16) /* require jewel for booting osds */
+#define CEPH_OSDMAP_REQUIRE_KRAKEN (1<<17) /* require kraken for booting osds */
 
 /*
  * The error code to return when an OSD can't handle a write
index 801ae887f80621f22b9da5b0f19e1f3a97f733e8..da695c0a53801cd6e7f983640bdb27ab99d1245a 100644 (file)
@@ -126,8 +126,9 @@ void OSDMonitor::create_initial()
   // new clusters should sort bitwise by default.
   newmap.set_flag(CEPH_OSDMAP_SORTBITWISE);
 
-  // new cluster should require jewel by default
+  // new cluster should require jewel and kraken by default
   newmap.set_flag(CEPH_OSDMAP_REQUIRE_JEWEL);
+  newmap.set_flag(CEPH_OSDMAP_REQUIRE_KRAKEN);
 
   // encode into pending incremental
   newmap.encode(pending_inc.fullmap, mon->quorum_features | CEPH_FEATURE_RESERVED);
@@ -1979,6 +1980,16 @@ bool OSDMonitor::preprocess_boot(MonOpRequestRef op)
     goto ignore;
   }
 
+  if (osdmap.test_flag(CEPH_OSDMAP_REQUIRE_KRAKEN) &&
+      !(m->osd_features & CEPH_FEATURE_SERVER_KRAKEN)) {
+    mon->clog->info() << "disallowing boot of OSD "
+                     << m->get_orig_source_inst()
+                     << " because the osdmap requires"
+                     << " CEPH_FEATURE_SERVER_KRAKEN"
+                     << " but the osd lacks CEPH_FEATURE_SERVER_KRAKEN\n";
+    goto ignore;
+  }
+
   if (osdmap.test_flag(CEPH_OSDMAP_SORTBITWISE) &&
       !(m->osd_features & CEPH_FEATURE_OSD_BITWISE_HOBJ_SORT)) {
     mon->clog->info() << "disallowing boot of OSD "
@@ -6334,6 +6345,13 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op,
        ss << "not all up OSDs have CEPH_FEATURE_SERVER_JEWEL feature";
        err = -EPERM;
       }
+    } else if (key == "require_kraken_osds") {
+      if (osdmap.get_up_osd_features() & CEPH_FEATURE_SERVER_KRAKEN) {
+       return prepare_set_flag(op, CEPH_OSDMAP_REQUIRE_KRAKEN);
+      } else {
+       ss << "not all up OSDs have CEPH_FEATURE_SERVER_KRAKEN feature";
+       err = -EPERM;
+      }
     } else {
       ss << "unrecognized flag '" << key << "'";
       err = -EINVAL;