You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Savonitar (via GitHub)" <gi...@apache.org> on 2026/02/03 19:01:20 UTC

Re: [PR] [hotfix] Wait for leader election to prevent OUT_OF_ORDER issues [flink-connector-kafka]

Savonitar commented on code in PR #220:
URL: https://github.com/apache/flink-connector-kafka/pull/220#discussion_r2760560386


##########
flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/KafkaTestEnvironmentImpl.java:
##########
@@ -164,7 +164,11 @@ public static void createNewTopic(
                             return false;
                         }
                         TopicDescription topicDescription = topicDescriptions.get(topic);
-                        return topicDescription.partitions().size() == numberOfPartitions;
+                        if (topicDescription.partitions().size() != numberOfPartitions) {
+                            return false;
+                        }
+                        return topicDescription.partitions().stream()
+                                .allMatch(p -> p.leader() != null && p.leader().id() >= 0);

Review Comment:
   Thank you, it is better. Fixed.



-- 
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-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org