Skip to content

Commit

Permalink
v1.17: Improves error text when snapshot intervals are incompatible (…
Browse files Browse the repository at this point in the history
…backport of #33551) (#33562)

(cherry picked from commit 35a0295)

Co-authored-by: Brooks <brooks@solana.com>
  • Loading branch information
mergify[bot] and brooksprumo authored Oct 6, 2023
1 parent 3cdee9b commit a330ffc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion validator/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ pub fn app<'a>(version: &'a str, default_args: &'a DefaultArgs) -> App<'a, 'a> {
.value_name("NUMBER")
.takes_value(true)
.default_value(&default_args.full_snapshot_archive_interval_slots)
.help("Number of slots between generating full snapshots")
.help("Number of slots between generating full snapshots. \
Must be a multiple of the incremental snapshot interval.")
)
.arg(
Arg::with_name("maximum_full_snapshots_to_retain")
Expand Down
9 changes: 3 additions & 6 deletions validator/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1588,17 +1588,14 @@ pub fn main() {
validator_config.accounts_hash_interval_slots,
) {
eprintln!("Invalid snapshot configuration provided: snapshot intervals are incompatible. \
\n\t- full snapshot interval MUST be a multiple of accounts hash interval (if enabled) \
\n\t- incremental snapshot interval MUST be a multiple of accounts hash interval (if enabled) \
\n\t- full snapshot interval MUST be a multiple of incremental snapshot interval (if enabled) \
\n\t- full snapshot interval MUST be larger than incremental snapshot interval (if enabled) \
\nSnapshot configuration values: \
\n\tfull snapshot interval: {} \
\n\tincremental snapshot interval: {} \
\n\taccounts hash interval: {}",
\n\tincremental snapshot interval: {}",
if full_snapshot_archive_interval_slots == DISABLED_SNAPSHOT_ARCHIVE_INTERVAL { "disabled".to_string() } else { full_snapshot_archive_interval_slots.to_string() },
if incremental_snapshot_archive_interval_slots == DISABLED_SNAPSHOT_ARCHIVE_INTERVAL { "disabled".to_string() } else { incremental_snapshot_archive_interval_slots.to_string() },
validator_config.accounts_hash_interval_slots);

);
exit(1);
}

Expand Down

0 comments on commit a330ffc

Please sign in to comment.