OPTION(osd_debug_skip_full_check_in_backfill_reservation, OPT_BOOL, false)
OPTION(osd_debug_reject_backfill_probability, OPT_DOUBLE, 0)
OPTION(osd_debug_inject_copyfrom_error, OPT_BOOL, false) // inject failure during copyfrom completion
+OPTION(osd_debug_randomize_hobject_sort_order, OPT_BOOL, false)
OPTION(osd_enable_op_tracker, OPT_BOOL, true) // enable/disable OSD op tracking
OPTION(osd_num_op_tracker_shard, OPT_U32, 32) // The number of shards for holding the ops
OPTION(osd_op_history_size, OPT_U32, 20) // Max number of completed ops to track
pg_id(p),
peer_features(CEPH_FEATURES_SUPPORTED_DEFAULT),
acting_features(CEPH_FEATURES_SUPPORTED_DEFAULT),
- upacting_features(CEPH_FEATURES_SUPPORTED_DEFAULT)
+ upacting_features(CEPH_FEATURES_SUPPORTED_DEFAULT),
+ randomly_sort_nibblewise(false)
{
#ifdef PG_DEBUG_REFS
osd->add_pgid(p, this);
upacting_features &= osdmap->get_xinfo(*p).features;
}
+ if (g_conf->osd_debug_randomize_hobject_sort_order) {
+ // randomly use a nibblewise sort (when we otherwise might have
+ // done bitwise) based on some *deterministic* function such that
+ // all peers/osds will agree.
+ randomly_sort_nibblewise = (info.history.same_interval_since + info.pgid.ps()) & 1;
+ } else {
+ randomly_sort_nibblewise = false;
+ }
+
dout(10) << " up " << oldup << " -> " << up
<< ", acting " << oldacting << " -> " << acting
<< ", acting_primary " << old_acting_primary << " -> " << new_acting_primary
uint64_t acting_features;
uint64_t upacting_features;
+ bool randomly_sort_nibblewise;
+
public:
const spg_t& get_pgid() const { return pg_id; }
int get_nrep() const { return acting.size(); }
/// 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;
+ return (get_min_upacting_features() & CEPH_FEATURE_OSD_BITWISE_HOBJ_SORT) &&
+ !randomly_sort_nibblewise;
}
void init_primary_up_acting(