choose highest incremental snapshot first (#25584)

This commit is contained in:
DimAn 2022-06-03 00:12:03 +03:00 committed by GitHub
parent 6fc057c1d9
commit 395dbc0f40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -1108,8 +1108,8 @@ mod with_incremental_snapshots {
///
/// The result is a vector of peers with snapshot hashes that:
/// 1. match a snapshot hash from the known validators
/// 2. have the highest full snapshot slot
/// 3. have the highest incremental snapshot slot
/// 2. have the highest incremental snapshot slot
/// 3. have the highest full snapshot slot of (2)
fn get_peer_snapshot_hashes(
cluster_info: &ClusterInfo,
validator_config: &ValidatorConfig,
@ -1124,10 +1124,10 @@ mod with_incremental_snapshots {
&mut peer_snapshot_hashes,
);
}
retain_peer_snapshot_hashes_with_highest_full_snapshot_slot(&mut peer_snapshot_hashes);
retain_peer_snapshot_hashes_with_highest_incremental_snapshot_slot(
&mut peer_snapshot_hashes,
);
retain_peer_snapshot_hashes_with_highest_full_snapshot_slot(&mut peer_snapshot_hashes);
peer_snapshot_hashes
}