Skip to content

Commit

Permalink
KAFKA-16709: add comments to explain the possible race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
showuon committed May 23, 2024
1 parent 4a1b76d commit 0d78e49
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion core/src/main/scala/kafka/server/ReplicaManager.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2127,8 +2127,11 @@ class ReplicaManager(val config: KafkaConfig,
}
}

if (futureReplicasAndInitialOffset.nonEmpty)
if (futureReplicasAndInitialOffset.nonEmpty) {
// Even though it's possible that there is another thread adding fetcher for this future log partition,
// but it's fine because `BrokerIdAndFetcherId` will be identical the operation will be no-op.
replicaAlterLogDirsManager.addFetcherForPartitions(futureReplicasAndInitialOffset)
}
}

/*
Expand Down

0 comments on commit 0d78e49

Please sign in to comment.