mas-chen commented on code in PR #19456: URL: https://github.com/apache/flink/pull/19456#discussion_r851041663
########## flink-connectors/flink-connector-kafka/src/main/java/org/apache/flink/connector/kafka/source/reader/KafkaPartitionSplitReader.java: ########## @@ -131,12 +138,7 @@ public RecordsWithSplitIds<ConsumerRecord<byte[], byte[]>> fetch() throws IOExce kafkaSourceReaderMetrics.maybeAddRecordsLagMetric(consumer, tp); } - // Some splits are discovered as empty when handling split additions. These splits should be - // added to finished splits to clean up states in split fetcher and source reader. - if (!emptySplits.isEmpty()) { - recordsBySplits.finishedSplits.addAll(emptySplits); - emptySplits.clear(); - } + markEmptySplitsAsFinished(recordsBySplits); Review Comment: Good catch! -- 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: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org