chance_thrash_pg_upmap: 1.0
chance_thrash_pg_upmap_items: 1.0
+ aggressive_pg_num_changes: (true) whether we should bypass the careful throttling of pg_num and pgp_num changes in mgr's adjust_pgs() controller
+
example:
tasks:
config['noscrub_toggle_delay'] = config.get('noscrub_toggle_delay', 2.0)
# add default value for random_eio
config['random_eio'] = config.get('random_eio', 0.0)
+ aggro = config.get('aggressive_pg_num_changes', True)
log.info("config is {config}".format(config=str(config)))
if config.get(f):
cluster_manager.config[f] = config.get(f)
+ if aggro:
+ cluster_manager.raw_cluster_cmd(
+ 'config', 'set', 'mgr',
+ 'mgr_debug_aggressive_pg_num_changes',
+ 'true')
+
log.info('Beginning thrashosds...')
thrash_proc = ceph_manager.Thrasher(
cluster_manager,
cluster_manager.wait_for_all_osds_up()
cluster_manager.flush_all_pg_stats()
cluster_manager.wait_for_recovery(config.get('timeout', 360))
+ if aggro:
+ cluster_manager.raw_cluster_cmd(
+ 'config', 'rm', 'mgr',
+ 'mgr_debug_aggressive_pg_num_changes')
dout(20) << dendl;
unsigned max = std::max<int64_t>(1, g_conf()->mon_osd_max_creating_pgs);
double max_misplaced = g_conf().get_val<double>("target_max_misplaced_ratio");
+ bool aggro = g_conf().get_val<bool>("mgr_debug_aggressive_pg_num_changes");
map<string,unsigned> pg_num_to_set;
map<string,unsigned> pgp_num_to_set;
<< " pgp_num " << p.get_pgp_num()
<< " - increase blocked by pg_num " << p.get_pg_num()
<< dendl;
- } else if (inactive_pgs_ratio > 0 ||
- degraded_ratio > 0 ||
- unknown_pgs_ratio > 0) {
+ } else if (!aggro && (inactive_pgs_ratio > 0 ||
+ degraded_ratio > 0 ||
+ unknown_pgs_ratio > 0)) {
dout(10) << "pool " << i.first
<< " pgp_num_target " << p.get_pgp_num_target()
<< " pgp_num " << p.get_pgp_num()
<< " - inactive|degraded|unknown pgs, deferring pgp_num"
<< " update" << dendl;
- } else if (misplaced_ratio > max_misplaced) {
+ } else if (!aggro && (misplaced_ratio > max_misplaced)) {
dout(10) << "pool " << i.first
<< " pgp_num_target " << p.get_pgp_num_target()
<< " pgp_num " << p.get_pgp_num()
// single adjustment that's more than half of the
// max_misplaced, to somewhat limit the magnitude of
// our potential error here.
- double room =
- std::min<double>(max_misplaced - misplaced_ratio,
- misplaced_ratio / 2.0);
- unsigned estmax = std::max<unsigned>(
- (double)p.get_pg_num() * room, 1u);
- int delta = target - p.get_pgp_num();
- int next = p.get_pgp_num();
- if (delta < 0) {
- next += std::max<int>(-estmax, delta);
+ int next;
+ if (aggro) {
+ next = target;
} else {
- next += std::min<int>(estmax, delta);
+ double room =
+ std::min<double>(max_misplaced - misplaced_ratio,
+ misplaced_ratio / 2.0);
+ unsigned estmax = std::max<unsigned>(
+ (double)p.get_pg_num() * room, 1u);
+ int delta = target - p.get_pgp_num();
+ next = p.get_pgp_num();
+ if (delta < 0) {
+ next += std::max<int>(-estmax, delta);
+ } else {
+ next += std::min<int>(estmax, delta);
+ }
+ dout(20) << " room " << room << " estmax " << estmax
+ << " delta " << delta << " next " << next << dendl;
}
- dout(20) << " room " << room << " estmax " << estmax
- << " delta " << delta << " next " << next << dendl;
dout(10) << "pool " << i.first
<< " pgp_num_target " << p.get_pgp_num_target()
<< " pgp_num " << p.get_pgp_num()