You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by sh...@apache.org on 2022/12/21 03:19:29 UTC

[kafka] branch trunk updated: KAFKA-14498: reduce the startup nodes to avoid timeout error (#13016)

This is an automated email from the ASF dual-hosted git repository.

showuon pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/kafka.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 25753626398 KAFKA-14498: reduce the startup nodes to avoid timeout error (#13016)
25753626398 is described below

commit 2575362639887f56bc6869337d742247632bdaeb
Author: Luke Chen <sh...@gmail.com>
AuthorDate: Wed Dec 21 11:19:22 2022 +0800

    KAFKA-14498: reduce the startup nodes to avoid timeout error (#13016)
    
    In MetadataQuorumCommandTest, we sometimes got the error:
    
    java.util.concurrent.ExecutionException: java.lang.RuntimeException: Received a fatal error while waiting for the broker to catch up with the current cluster metadata.
    
    Since we tried to bring up 3 broker + 3 controllers at the same time, and the config initial.broker.registration.timeout.ms (default 1 min) is sometimes not enough for them to start up. Checking the tests, it doesn't require so many nodes. Reducing the nodes number to make these tests reliable.
    
    Reviewers: dengziming <de...@gmail.com>, Ismael Juma <is...@juma.me.uk>
---
 .../kafka/tools/MetadataQuorumCommandTest.java     | 26 +++++++++++-----------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/tools/src/test/java/org/apache/kafka/tools/MetadataQuorumCommandTest.java b/tools/src/test/java/org/apache/kafka/tools/MetadataQuorumCommandTest.java
index 7b52b351afd..bd4a7a0c07c 100644
--- a/tools/src/test/java/org/apache/kafka/tools/MetadataQuorumCommandTest.java
+++ b/tools/src/test/java/org/apache/kafka/tools/MetadataQuorumCommandTest.java
@@ -53,12 +53,12 @@ class MetadataQuorumCommandTest {
      * 3. Fewer brokers than controllers
      */
     @ClusterTests({
-        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 3, controllers = 3),
-        @ClusterTest(clusterType = Type.KRAFT, brokers = 3, controllers = 3),
-        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 3, controllers = 2),
-        @ClusterTest(clusterType = Type.KRAFT, brokers = 3, controllers = 2),
-        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 2, controllers = 3),
-        @ClusterTest(clusterType = Type.KRAFT, brokers = 2, controllers = 3)
+        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 2, controllers = 2),
+        @ClusterTest(clusterType = Type.KRAFT, brokers = 2, controllers = 2),
+        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 2, controllers = 1),
+        @ClusterTest(clusterType = Type.KRAFT, brokers = 2, controllers = 1),
+        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 1, controllers = 2),
+        @ClusterTest(clusterType = Type.KRAFT, brokers = 1, controllers = 2)
     })
     public void testDescribeQuorumReplicationSuccessful() throws InterruptedException {
         cluster.waitForReadyBrokers();
@@ -94,12 +94,12 @@ class MetadataQuorumCommandTest {
      * 3. Fewer brokers than controllers
      */
     @ClusterTests({
-        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 3, controllers = 3),
-        @ClusterTest(clusterType = Type.KRAFT, brokers = 3, controllers = 3),
-        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 3, controllers = 2),
-        @ClusterTest(clusterType = Type.KRAFT, brokers = 3, controllers = 2),
-        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 2, controllers = 3),
-        @ClusterTest(clusterType = Type.KRAFT, brokers = 2, controllers = 3)
+        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 2, controllers = 2),
+        @ClusterTest(clusterType = Type.KRAFT, brokers = 2, controllers = 2),
+        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 2, controllers = 1),
+        @ClusterTest(clusterType = Type.KRAFT, brokers = 2, controllers = 1),
+        @ClusterTest(clusterType = Type.CO_KRAFT, brokers = 1, controllers = 2),
+        @ClusterTest(clusterType = Type.KRAFT, brokers = 1, controllers = 2)
     })
     public void testDescribeQuorumStatusSuccessful() throws InterruptedException {
         cluster.waitForReadyBrokers();
@@ -141,7 +141,7 @@ class MetadataQuorumCommandTest {
         assertEquals("0", replicationOutput.split("\n")[1].split("\\s+")[2]);
     }
 
-    @ClusterTest(clusterType = Type.ZK, brokers = 3)
+    @ClusterTest(clusterType = Type.ZK, brokers = 1)
     public void testDescribeQuorumInZkMode() {
         assertTrue(
             assertThrows(