]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osd: add OSD_BITWISE_HOBJ_SORT feature
authorSage Weil <sage@redhat.com>
Mon, 8 Jun 2015 16:53:10 +0000 (09:53 -0700)
committerSage Weil <sage@redhat.com>
Fri, 7 Aug 2015 14:16:00 +0000 (10:16 -0400)
We will sort [g]hobject_t's bitwise (instead of nibblewise) if all
OSDs who have participated in peering support the feature.

Note that this means a latecomer PG who does a notify may not have
the feature while the acting set operates with the new sort order.
We will need to be careful about last_backfill in this case.. that patch
it coming.

Signed-off-by: Sage Weil <sage@redhat.com>
src/include/ceph_features.h
src/osd/PG.h
src/osd/ReplicatedPG.h

index b00fd5600d4275572ba4e92e552794fa9d3b4fb4..2a4d4993c1fc6bc262749a6d7bb5d77fcacdfeae 100644 (file)
@@ -64,6 +64,7 @@
 // duplicated since it was introduced at the same time as MIN_SIZE_RECOVERY
 #define CEPH_FEATURE_OSD_PROXY_FEATURES (1ULL<<49)  /* overlap w/ above */
 #define CEPH_FEATURE_MON_METADATA (1ULL<<50)
+#define CEPH_FEATURE_OSD_BITWISE_HOBJ_SORT (1ULL<<51) /* can sort objs bitwise */
 
 #define CEPH_FEATURE_RESERVED2 (1ULL<<61)  /* slow down, we are almost out... */
 #define CEPH_FEATURE_RESERVED  (1ULL<<62)  /* DO NOT USE THIS ... last bit! */
@@ -150,6 +151,7 @@ static inline unsigned long long ceph_sanitize_features(unsigned long long f) {
          CEPH_FEATURE_CRUSH_V4 |            \
          CEPH_FEATURE_OSD_MIN_SIZE_RECOVERY |           \
         CEPH_FEATURE_MON_METADATA |                     \
+        CEPH_FEATURE_OSD_BITWISE_HOBJ_SORT |            \
         0ULL)
 
 #define CEPH_FEATURES_SUPPORTED_DEFAULT  CEPH_FEATURES_ALL
index 39d48a1f657587b1299ee07f8626379584d42d1f..840d4e0c328fb233df4ff01644c7160838cf2d5a 100644 (file)
@@ -2031,6 +2031,11 @@ public:
   void apply_acting_features(uint64_t f) { acting_features &= f; }
   void apply_upacting_features(uint64_t f) { upacting_features &= f; }
 
+  /// true if we will sort hobjects bitwise for this pg interval
+  bool get_sort_bitwise() const {
+    return get_min_upacting_features() & CEPH_FEATURE_OSD_BITWISE_HOBJ_SORT;
+  }
+
   void init_primary_up_acting(
     const vector<int> &newup,
     const vector<int> &newacting,
index 419aa7414230dca81fe517ec81d56d29e1a42a58..f4d77976c7f3f1bb361a4b4047c6db41ecb56c1c 100644 (file)
@@ -449,6 +449,9 @@ public:
   uint64_t min_peer_features() const {
     return get_min_peer_features();
   }
+  bool sort_bitwise() const {
+    return get_sort_bitwise();
+  }
 
   bool transaction_use_tbl() {
     uint64_t min_features = get_min_upacting_features();