Closed Djeezus closed 2 years ago
It's not a bug, it's because the default "partition_assignment_strategy" is "Range" .. When explicitly defining "cooperative_sticky", the consumer_group instances get distributed out over all the topics' partitions
Maybe the default parameter for "partition_assignment_strategy" can be changed to "cooperative_sticky", and that way automatically leveraging the consumer.group spreading when using topics_pattern and/or multiple topics.
Logstash information:
Please include the following information:
JVM (e.g.
java -version
):sh-4.2$ logstash --version Using bundled JDK: /usr/share/logstash/jdk warning: no jvm.options file found logstash 7.14.0
OS version (
uname -a
if on a Unix-like system): sh-4.2$ uname -a Linux logstash 3.10.0-1127.el7.x86_64 #1 SMP Tue Feb 18 16:39:12 EST 2020 x86_64 x86_64 x86_64 GNU/LinuxDescription of the problem including expected versus actual behavior: The topics_pattern is an excellent feature, but it has introduced an issue when it comes to consumer parallelism I think. It seems that the "topics_pattern" will match a number of Kafka-topics but it doesn't take into account horizontal scaling of logstash-instances.
I have a setup where my "topics_pattern" matches currently 2 topics, and each topic has 2 partitions ...
It seems though as if the "topics_pattern" is actually limiting the parallelism, and assigning somehow the consumer-role to an (arbitrary?) Logstash-instance ?
Steps to reproduce:
create 2 kafka topics with eacht 2 partitions : test-topic-aa test-topic-bb
create 4 logstash instances and define in Kafka input topics_pattern => "test-topic.*"
produce some messages on the topics, and spawn 4 logstash instances ...
you will see that only 2 logstash instances are consuming from the in total 4 partitions Provide logs (if relevant):