spuru9 commented on code in PR #305:
URL:
https://github.com/apache/flink-connector-kafka/pull/305#discussion_r3971084738
##########
flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/source/enumerator/KafkaSourceEnumerator.java:
##########
Review Comment:
**major:** Same race, unguarded here. A migrated split stays `isMigrated()`
in `unassignedSplits` until `handlePartitionSplitChanges` overwrites it, so if
discovery fires again while its `initializePartitionSplits` is in flight, this
loop re-adds it to `initialPartitions` and dispatches a second time. I
reproduced the double-dispatch in a test; the guard below fixes it.
```
// migration path, ensure that partitions without offset are
properly initialized
for (KafkaPartitionSplit split : unassignedSplits.values()) {
if (split.isMigrated()
&&
!partitionsBeingInitialized.contains(split.getTopicPartition())) {
initialPartitions.add(split.getTopicPartition());
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]