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
On version 1.3.13, after rebalance operation, addAssignListener callback is called only if a partition is assigned to a consumer. So, when we have more consumers than partition size, addAssignListener callback is only triggering on the instances with partition assignment.
After version 1.3.15 it's called(with empty list) even when there is no assignment to the consumer. It is also working like this on version 1.3.17.
In our case, we had a logic inside that method and we made a fix to handle this case.
I didn't see any changes about this on 1.3.15 release notes so I'm wondering if it is working as intended now or it is a bug?
Expected Behavior
When we have more consumers(with same group-id) than topic partitions, addAssignListener callback should be triggered only on partition assigned consumers.
Actual Behavior
When we have more consumers(with same group-id) than partitions, addAssignListener callback is triggering on every consumer(With empty partition list) even if the consumer is not assigned to a partition.
Steps to Reproduce
I have a topic with 1 partition and I'm running multiple consumers with same group-id. When I start first consumer instance addAssignListener callback is called with [topic-0] . Then I start a new instance and after rebalance let's say first instance is assigned again to partition, revoke listener and assign listener is called on the first instance as expected.
Previously(on version 1.3.13), assignListener callback wasn't triggering on 2nd instance since there is no partitions left to consume, however after version 1.3.15, it is triggering with an empty array.
The revoke listener is not called if onAssign callback was called with an empty collection. Hence new behavior removed the symmetry.
With that perspective(which makes sense), now the application has no indication that it stopped running with an idle consumer as well. Should it call onRevoke in case onAssign was called with empty list of partitions?
That is because the kafka-clients does not call the ConsumerRebalanceListener in that case (if none were previously assigned), which makes sense - if you weren't assigned any partitions, why do you need to be told that nothing was revoked? In any case, that is out of this project's control.
In my opinion, the listeners should be a simple pass-through of the CRL calls.
no indication that it stopped running with an idle consumer
revocation occurs under 2 circumstances - a rebalance, or when the Disposable is disposed (or the consumer is stopped); in the first case, you don't need a notification because you have no assignments; in the second case, it means you stopped the app.
On version 1.3.13, after rebalance operation, addAssignListener callback is called only if a partition is assigned to a consumer. So, when we have more consumers than partition size, addAssignListener callback is only triggering on the instances with partition assignment.
After version 1.3.15 it's called(with empty list) even when there is no assignment to the consumer. It is also working like this on version 1.3.17.
In our case, we had a logic inside that method and we made a fix to handle this case.
I didn't see any changes about this on 1.3.15 release notes so I'm wondering if it is working as intended now or it is a bug?
Expected Behavior
When we have more consumers(with same group-id) than topic partitions, addAssignListener callback should be triggered only on partition assigned consumers.
Actual Behavior
When we have more consumers(with same group-id) than partitions, addAssignListener callback is triggering on every consumer(With empty partition list) even if the consumer is not assigned to a partition.
Steps to Reproduce
I have a topic with 1 partition and I'm running multiple consumers with same group-id. When I start first consumer instance addAssignListener callback is called with [topic-0] . Then I start a new instance and after rebalance let's say first instance is assigned again to partition, revoke listener and assign listener is called on the first instance as expected.
Previously(on version 1.3.13), assignListener callback wasn't triggering on 2nd instance since there is no partitions left to consume, however after version 1.3.15, it is triggering with an empty array.
Your Environment
netty
, ...):java -version
): 17uname -a
):The text was updated successfully, but these errors were encountered: