patches bug in turbine's neighbors computation (#14565)
Removing local node's index early from the set here: https://github.com/solana-labs/solana/blob/e1b59ded4/core/src/retransmit_stage.rs#L346 distorts the order of nodes depending on which node is computing the turbine fan-out tree, and results in incorrect neighbors computation.
This commit is contained in:
parent
19bd30262a
commit
cfcca1cd3c
|
@ -336,14 +336,13 @@ fn retransmit(
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut compute_turbine_peers = Measure::start("turbine_start");
|
let mut compute_turbine_peers = Measure::start("turbine_start");
|
||||||
let (my_index, mut shuffled_stakes_and_index) = ClusterInfo::shuffle_peers_and_index(
|
let (my_index, shuffled_stakes_and_index) = ClusterInfo::shuffle_peers_and_index(
|
||||||
&my_id,
|
&my_id,
|
||||||
&r_epoch_stakes_cache.peers,
|
&r_epoch_stakes_cache.peers,
|
||||||
&r_epoch_stakes_cache.stakes_and_index,
|
&r_epoch_stakes_cache.stakes_and_index,
|
||||||
packet.meta.seed,
|
packet.meta.seed,
|
||||||
);
|
);
|
||||||
peers_len = cmp::max(peers_len, shuffled_stakes_and_index.len());
|
peers_len = cmp::max(peers_len, shuffled_stakes_and_index.len());
|
||||||
shuffled_stakes_and_index.remove(my_index);
|
|
||||||
// split off the indexes, we don't need the stakes anymore
|
// split off the indexes, we don't need the stakes anymore
|
||||||
let indexes = shuffled_stakes_and_index
|
let indexes = shuffled_stakes_and_index
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -354,7 +353,14 @@ fn retransmit(
|
||||||
compute_retransmit_peers(DATA_PLANE_FANOUT, my_index, indexes);
|
compute_retransmit_peers(DATA_PLANE_FANOUT, my_index, indexes);
|
||||||
let neighbors: Vec<_> = neighbors
|
let neighbors: Vec<_> = neighbors
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|index| &r_epoch_stakes_cache.peers[index])
|
.filter_map(|index| {
|
||||||
|
let peer = &r_epoch_stakes_cache.peers[index];
|
||||||
|
if peer.id == my_id {
|
||||||
|
None
|
||||||
|
} else {
|
||||||
|
Some(peer)
|
||||||
|
}
|
||||||
|
})
|
||||||
.collect();
|
.collect();
|
||||||
let children: Vec<_> = children
|
let children: Vec<_> = children
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
Loading…
Reference in New Issue