From: Sage Weil Date: Mon, 8 Jun 2015 16:53:10 +0000 (-0700) Subject: osd: add OSD_BITWISE_HOBJ_SORT feature X-Git-Tag: v9.1.0~346^2~66 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=73b3ed87c16fa66c9e2f77b9dadcb2615a118201;p=ceph.git osd: add OSD_BITWISE_HOBJ_SORT feature 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 --- diff --git a/src/include/ceph_features.h b/src/include/ceph_features.h index b00fd5600d4..2a4d4993c1f 100644 --- a/src/include/ceph_features.h +++ b/src/include/ceph_features.h @@ -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 diff --git a/src/osd/PG.h b/src/osd/PG.h index 39d48a1f657..840d4e0c328 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -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 &newup, const vector &newacting, diff --git a/src/osd/ReplicatedPG.h b/src/osd/ReplicatedPG.h index 419aa741423..f4d77976c7f 100644 --- a/src/osd/ReplicatedPG.h +++ b/src/osd/ReplicatedPG.h @@ -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();