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

Improves error text when snapshot intervals are incompatible #33551

Merged
merged 1 commit into from
Oct 6, 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
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.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think of:

Must be a multiple of --incremental-snapshot-interval-slots value

I mention this as I see --no-incremental-snapshots specifically mention args like this, but I'm fine with what you have as well. I don't think we have a hard rule on this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tricky thing is that we alias --snapshot-interval and --incremental-snapshot-interval. I didn't want to put 'em both here in the text for fear of being too long.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah true, I used the more explicit value but I see your point.

)
.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