confluentinc / confluent-kafka-dotnet

Confluent's Apache Kafka .NET client
https://github.com/confluentinc/confluent-kafka-dotnet/wiki
Apache License 2.0
2.78k stars 847 forks source link

Violating partition assignment #2201

Open ksdvishnukumar opened 3 months ago

ksdvishnukumar commented 3 months ago

Description

I came across the below scenario in one of environment. I have a Topic (EventHub) with 3 partitions. I spanned up 3 consumers ideally each consumer should be assigned with one partition each. But from the PartitionAssignmenedHandler I see that, one consumer(Consumer1) took all the 3 partitions. But I observed that, Consumer2 received the partition 1 data even though there is no assignment to Consumer2 (Via PartitionAssignmenedHandler) and No revoke/loss assignment to Consumer1 (SetPartitionsRevokedHandler/SetPartitionsLostHandler). The core of the partition distribution itself violating which leads to duplicate message receiving. I understand that there is no rebalancing happened in this case and also no error/exception occurred.

Consumers are deployed to AKS and consumer are connecting to Azure Eventhub using Confluent Kafka Package (2.1.1)

How to reproduce

Could not be able to reproduce in the lower environment as this issue happened in production so there is no way to get the Debug logs.

Checklist

Please provide the following information:

ksdvishnukumar commented 2 months ago

Hi @mhowlett , @edenhill

Is there any workaround on this can be implemented based on the Consumer configuration?