Skip to content

Commit

Permalink
osd: add OSD_BITWISE_HOBJ_SORT feature
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
liewegas committed Aug 7, 2015
1 parent f72ba6e commit 73b3ed8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/include/ceph_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -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! */
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions src/osd/PG.h
Original file line number Diff line number Diff line change
Expand Up @@ -2031,6 +2031,11 @@ class PG {
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,
Expand Down
3 changes: 3 additions & 0 deletions src/osd/ReplicatedPG.h
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,9 @@ class ReplicatedPG : public PG, public PGBackend::Listener {
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();
Expand Down

0 comments on commit 73b3ed8

Please sign in to comment.