Add validator option to change niceness of snapshot packager thread

This commit is contained in:
Ivan Mironov
2021-10-27 06:56:16 +05:00
committed by Trent Nelson
parent 18b1baa3c1
commit c78f474373
6 changed files with 51 additions and 2 deletions

View File

@ -10,8 +10,8 @@ use {
solana_clap_utils::{
input_parsers::{keypair_of, keypairs_of, pubkey_of, value_of},
input_validators::{
is_keypair, is_keypair_or_ask_keyword, is_parsable, is_pow2, is_pubkey,
is_pubkey_or_keypair, is_slot, is_valid_percentage,
is_keypair, is_keypair_or_ask_keyword, is_niceness_adjustment_valid, is_parsable,
is_pow2, is_pubkey, is_pubkey_or_keypair, is_slot, is_valid_percentage,
},
keypair::SKIP_SEED_PHRASE_VALIDATION_ARG,
},
@ -910,6 +910,16 @@ pub fn main() {
.default_value(default_maximum_incremental_snapshot_archives_to_retain)
.help("The maximum number of incremental snapshot archives to hold on to when purging older snapshots.")
)
.arg(
Arg::with_name("snapshot_packager_niceness_adj")
.long("snapshot-packager-niceness-adjustment")
.value_name("ADJUSTMENT")
.takes_value(true)
.validator(is_niceness_adjustment_valid)
.default_value("0")
.help("Add this value to niceness of snapshot packager thread. Negative value \
increases priority, positive value decreases priority.")
)
.arg(
Arg::with_name("minimal_snapshot_download_speed")
.long("minimal-snapshot-download-speed")
@ -2328,6 +2338,8 @@ pub fn main() {
value_t_or_exit!(matches, "maximum_full_snapshots_to_retain", usize);
let maximum_incremental_snapshot_archives_to_retain =
value_t_or_exit!(matches, "maximum_incremental_snapshots_to_retain", usize);
let snapshot_packager_niceness_adj =
value_t_or_exit!(matches, "snapshot_packager_niceness_adj", i8);
let minimal_snapshot_download_speed =
value_t_or_exit!(matches, "minimal_snapshot_download_speed", f32);
let maximum_snapshot_download_abort =
@ -2395,6 +2407,7 @@ pub fn main() {
maximum_incremental_snapshot_archives_to_retain,
accounts_hash_use_index: validator_config.accounts_db_use_index_hash_calculation,
accounts_hash_debug_verify: validator_config.accounts_db_test_hash_calculation,
packager_thread_niceness_adj: snapshot_packager_niceness_adj,
});
validator_config.accounts_hash_interval_slots =