Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.17: validator: skip health check (backport of #33568) #33588

Merged
merged 1 commit into from
Oct 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions validator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1424,6 +1424,11 @@ pub fn app<'a>(version: &'a str, default_args: &'a DefaultArgs) -> App<'a, 'a> {
.long("skip-new-snapshot-check")
.help("Skip check for a new snapshot")
)
.arg(
Arg::with_name("skip_health_check")
.long("skip-health-check")
.help("Skip health check")
)
)
.subcommand(
SubCommand::with_name("authorized-voter")
Expand Down Expand Up @@ -1639,6 +1644,11 @@ pub fn app<'a>(version: &'a str, default_args: &'a DefaultArgs) -> App<'a, 'a> {
.long("skip-new-snapshot-check")
.help("Skip check for a new snapshot")
)
.arg(
Arg::with_name("skip_health_check")
.long("skip-health-check")
.help("Skip health check")
)
.after_help("Note: If this command exits with a non-zero status \
then this not a good time for a restart")
).
Expand Down
7 changes: 6 additions & 1 deletion validator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ fn wait_for_restart_window(
min_idle_time_in_minutes: usize,
max_delinquency_percentage: u8,
skip_new_snapshot_check: bool,
skip_health_check: bool,
) -> Result<(), Box<dyn std::error::Error>> {
let sleep_interval = Duration::from_secs(5);

Expand Down Expand Up @@ -161,7 +162,7 @@ fn wait_for_restart_window(
seen_incremential_snapshot |= snapshot_slot_info_has_incremential;

let epoch_info = rpc_client.get_epoch_info_with_commitment(CommitmentConfig::processed())?;
let healthy = rpc_client.get_health().ok().is_some();
let healthy = skip_health_check || rpc_client.get_health().ok().is_some();
let delinquent_stake_percentage = {
let vote_accounts = rpc_client.get_vote_accounts()?;
let current_stake: u64 = vote_accounts
Expand Down Expand Up @@ -649,6 +650,7 @@ pub fn main() {
let force = subcommand_matches.is_present("force");
let monitor = subcommand_matches.is_present("monitor");
let skip_new_snapshot_check = subcommand_matches.is_present("skip_new_snapshot_check");
let skip_health_check = subcommand_matches.is_present("skip_health_check");
let max_delinquent_stake =
value_t_or_exit!(subcommand_matches, "max_delinquent_stake", u8);

Expand All @@ -659,6 +661,7 @@ pub fn main() {
min_idle_time,
max_delinquent_stake,
skip_new_snapshot_check,
skip_health_check,
)
.unwrap_or_else(|err| {
println!("{err}");
Expand Down Expand Up @@ -777,13 +780,15 @@ pub fn main() {
let max_delinquent_stake =
value_t_or_exit!(subcommand_matches, "max_delinquent_stake", u8);
let skip_new_snapshot_check = subcommand_matches.is_present("skip_new_snapshot_check");
let skip_health_check = subcommand_matches.is_present("skip_health_check");

wait_for_restart_window(
&ledger_path,
identity,
min_idle_time,
max_delinquent_stake,
skip_new_snapshot_check,
skip_health_check,
)
.unwrap_or_else(|err| {
println!("{err}");
Expand Down