You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 13, 2019. It is now read-only.
I have met with a bug: I have 32 partitions in one topic, and two consumers using the same group in this topic. When consumer A starts, it will consume all 32 partitions, as expected. But when the second consumer B starts, B will try to consume 16 partitions which have not been yield from consumer A yet.
So I just put some retry code to fix this bug, waiting for author's official fix. Somebody who has also met with this bug, can use this code temporarily.
In github.com/wvanbergen/kafka/consumergroup/consumer_group.go, line 339, function partitionConsumer:
retry_sec := 10
var err error
for i:=0; i< retry_sec; i++ {
err = cg.instance.ClaimPartition(topic, partition)
if err == nil {
break
}
cg.Logf("%s/%d :: Retry to Claim the partition : %s\n" ,topic, partition, partition)
time.Sleep(1*time.Second)
}
Thanks.
The text was updated successfully, but these errors were encountered:
sirfangx
changed the title
Try to FixBug: Two consumer compete partitions on zkpath: $kafka_root/consumers/$group/owners/$topic/{$partid1; $partid2...}
Try to FixBug: Two consumers compete partitions on zkpath: $kafka_root/consumers/$group/owners/$topic/{$partid1; $partid2...}
Aug 3, 2015
Hi
I have met with a bug: I have 32 partitions in one topic, and two consumers using the same group in this topic. When consumer A starts, it will consume all 32 partitions, as expected. But when the second consumer B starts, B will try to consume 16 partitions which have not been yield from consumer A yet.
So I just put some retry code to fix this bug, waiting for author's official fix. Somebody who has also met with this bug, can use this code temporarily.
In github.com/wvanbergen/kafka/consumergroup/consumer_group.go, line 339, function partitionConsumer:
change code from:
to
Thanks.
The text was updated successfully, but these errors were encountered: