choose highest incremental snapshot first (#25584)
This commit is contained in:
parent
6fc057c1d9
commit
395dbc0f40
|
@ -1108,8 +1108,8 @@ mod with_incremental_snapshots {
|
||||||
///
|
///
|
||||||
/// The result is a vector of peers with snapshot hashes that:
|
/// The result is a vector of peers with snapshot hashes that:
|
||||||
/// 1. match a snapshot hash from the known validators
|
/// 1. match a snapshot hash from the known validators
|
||||||
/// 2. have the highest full snapshot slot
|
/// 2. have the highest incremental snapshot slot
|
||||||
/// 3. have the highest incremental snapshot slot
|
/// 3. have the highest full snapshot slot of (2)
|
||||||
fn get_peer_snapshot_hashes(
|
fn get_peer_snapshot_hashes(
|
||||||
cluster_info: &ClusterInfo,
|
cluster_info: &ClusterInfo,
|
||||||
validator_config: &ValidatorConfig,
|
validator_config: &ValidatorConfig,
|
||||||
|
@ -1124,10 +1124,10 @@ mod with_incremental_snapshots {
|
||||||
&mut peer_snapshot_hashes,
|
&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(
|
retain_peer_snapshot_hashes_with_highest_incremental_snapshot_slot(
|
||||||
&mut peer_snapshot_hashes,
|
&mut peer_snapshot_hashes,
|
||||||
);
|
);
|
||||||
|
retain_peer_snapshot_hashes_with_highest_full_snapshot_slot(&mut peer_snapshot_hashes);
|
||||||
|
|
||||||
peer_snapshot_hashes
|
peer_snapshot_hashes
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue