Skip to content

Commit

Permalink
Review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
rukai committed Jun 13, 2024
1 parent c01a05c commit 03fb0bf
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions shotover/src/transforms/kafka/sink_cluster/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1398,19 +1398,19 @@ routing message to a random node so that:
// The out of date epoch is probably caused by requesting metadata from a broker that is slightly out of date.
// We use topic_by_name instead of topic_by_id since its always used regardless of protocol version.
if let Some(topic) = self.topic_by_name.get(topic_name) {
for partition in &topic.partitions {
for old_partition in &topic.partitions {
if let Some(base_partition) = base_partitions
.iter_mut()
.find(|p| p.index == partition.index)
.find(|p| p.index == old_partition.index)
{
if partition.leader_epoch > base_partition.leader_epoch {
base_partition.leader_id = partition.leader_id;
if old_partition.leader_epoch > base_partition.leader_epoch {
base_partition.leader_id = old_partition.leader_id;
base_partition
.shotover_rack_replica_nodes
.clone_from(&partition.shotover_rack_replica_nodes);
.clone_from(&old_partition.shotover_rack_replica_nodes);
base_partition
.external_rack_replica_nodes
.clone_from(&partition.external_rack_replica_nodes);
.clone_from(&old_partition.external_rack_replica_nodes);
}
}
}
Expand Down

0 comments on commit 03fb0bf

Please sign in to comment.