]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: refuse to boot if SORTBITWISE not set but backend cannot sort nibblewise
authorSage Weil <sage@redhat.com>
Fri, 7 Aug 2015 20:27:43 +0000 (16:27 -0400)
committerSage Weil <sage@redhat.com>
Mon, 17 Aug 2015 13:50:12 +0000 (09:50 -0400)
This prevenents OSDs with new backends from starting if the
cluster is still using the legacy sort order.

Signed-off-by: Sage Weil <sage@redhat.com>
src/os/FileStore.h
src/os/ObjectStore.h
src/osd/OSD.cc

index 744bdbd23f07023c7520e71874977f64cf67c5bb..9a52f0b344e9a0164119d5f3d4db24d0748498a2 100644 (file)
@@ -460,6 +460,10 @@ public:
    */
   bool get_allow_sharded_objects();
 
+  bool can_sort_nibblewise() {
+    return true;    // i support legacy sort order
+  }
+
   void collect_metadata(map<string,string> *pm);
 
   int statfs(struct statfs *buf);
index 7dc94094920ee4fce310947ac27866ea8a3c51ba..9651a697b7872ffb0c68777c4845bf7959cea52f 100644 (file)
@@ -1768,6 +1768,10 @@ public:
   virtual void set_allow_sharded_objects() = 0;
   virtual bool get_allow_sharded_objects() = 0;
 
+  virtual bool can_sort_nibblewise() {
+    return false;   // assume a backend cannot, unless it says otherwise
+  }
+
   virtual int statfs(struct statfs *buf) = 0;
 
   virtual void collect_metadata(map<string,string> *pm) { }
index 1cf9c838d1420624c04adfbba1e55b4dee4a1335..b7c2730abf04536fe99e36dd2a8d8d63eb583716 100644 (file)
@@ -4447,6 +4447,9 @@ void OSD::_maybe_boot(epoch_t oldest, epoch_t newest)
   // if our map within recent history, try to add ourselves to the osdmap.
   if (osdmap->test_flag(CEPH_OSDMAP_NOUP)) {
     dout(5) << "osdmap NOUP flag is set, waiting for it to clear" << dendl;
+  } else if (!osdmap->test_flag(CEPH_OSDMAP_SORTBITWISE) &&
+            !store->can_sort_nibblewise()) {
+    dout(1) << "osdmap SORTBITWISE flag is NOT set but our backend does not support nibblewise sort" << dendl;
   } else if (is_waiting_for_healthy() || !_is_healthy()) {
     // if we are not healthy, do not mark ourselves up (yet)
     dout(1) << "not healthy; waiting to boot" << dendl;