You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kafka.apache.org by gu...@apache.org on 2020/09/15 18:34:51 UTC

[kafka] branch 2.6 updated: KAFKA-10292: Set min.insync.replicas to 1 of __consumer_offsets (#9286)

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

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


The following commit(s) were added to refs/heads/2.6 by this push:
     new e8ea6f1  KAFKA-10292: Set min.insync.replicas to 1 of __consumer_offsets (#9286)
e8ea6f1 is described below

commit e8ea6f1e8c07371e40c8e6ab7ab6e2d6cb3a8804
Author: Bruno Cadonna <br...@confluent.io>
AuthorDate: Tue Sep 15 20:12:37 2020 +0200

    KAFKA-10292: Set min.insync.replicas to 1 of __consumer_offsets (#9286)
    
    The test StreamsBrokerBounceTest.test_all_brokers_bounce() fails on
    2.5 because in the last stage of the test there is only one broker
    left and the offset commit cannot succeed because the
    min.insync.replicas of __consumer_offsets is set to 2 and acks is
    set to all. This causes a time out and extends the closing of the
    Kafka Streams client to beyond the duration passed to the close
    method of the client.
    
    This affects especially the 2.5 branch since there Kafka Streams
    commits offsets for each task, i.e., close() needs to wait for the
    timeout for each task. In 2.6 and trunk the offset commit is done
    per thread, so close() does only need to wait for one time out per
    stream thread.
    
    I opened this PR on trunk, since the test could also become
    flaky on trunk and we want to avoid diverging system tests across
    branches.
    
    A more complete solution would be to improve the test by defining
    a better success criteria.
    
    Reviewers: Guozhang Wang <wa...@gmail.com>
---
 tests/kafkatest/tests/streams/streams_broker_bounce_test.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/tests/kafkatest/tests/streams/streams_broker_bounce_test.py b/tests/kafkatest/tests/streams/streams_broker_bounce_test.py
index 69f72d2..a0e6937 100644
--- a/tests/kafkatest/tests/streams/streams_broker_bounce_test.py
+++ b/tests/kafkatest/tests/streams/streams_broker_bounce_test.py
@@ -275,7 +275,14 @@ class StreamsBrokerBounceTest(Test):
         Start a smoke test client, then kill a few brokers and ensure data is still received
         Record if records are delivered
         """
-        self.setup_system() 
+
+        # Set min.insync.replicas to 1 because in the last stage of the test there is only one broker left.
+        # Otherwise the last offset commit will never succeed and time out and potentially take longer as
+        # duration passed to the close method of the Kafka Streams client.
+        self.topics['__consumer_offsets'] = { 'partitions': 50, 'replication-factor': self.replication,
+                                              'configs': {"min.insync.replicas": 1} }
+
+        self.setup_system()
 
         # Sleep to allow test to run for a bit
         time.sleep(120)