From: Sage Weil Date: Fri, 7 Aug 2015 20:27:43 +0000 (-0400) Subject: osd: refuse to boot if SORTBITWISE not set but backend cannot sort nibblewise X-Git-Tag: v9.1.0~346^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a5e27de5afd6bcf41cbd447b891dbe9e8081617d;p=ceph.git osd: refuse to boot if SORTBITWISE not set but backend cannot sort nibblewise This prevenents OSDs with new backends from starting if the cluster is still using the legacy sort order. Signed-off-by: Sage Weil --- diff --git a/src/os/FileStore.h b/src/os/FileStore.h index 744bdbd23f0..9a52f0b344e 100644 --- a/src/os/FileStore.h +++ b/src/os/FileStore.h @@ -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 *pm); int statfs(struct statfs *buf); diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 7dc94094920..9651a697b78 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -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 *pm) { } diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 1cf9c838d14..b7c2730abf0 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -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;