-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Do Not Resume Paused Partitions After a Rebalance #2222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
You can assign this to me @garyrussell, I should be able to pick it up sometime this week, in time for 2.8.5. Thanks! |
Thanks; I believe we also need to remove any |
Ok, sounds a bit more complicated than what I had anticipated 😄 Thanks for the pointers, when I open a PR we can discuss if that looks alright - and please let me know if you think of anything else. Considering there are some concepts I'm not that familiar with (never heard of cooperative rebalance before, sounds interesting), I'm not sure now if I can deliver it in time for us to properly review and discuss it before the next release. But we've come this far without this, hopefully it won't be a problem if we end up skipping one more version. Or, sounds like you have a solution figured out already, if you prefer to go ahead and implement it I'm ok with that too. Thanks! |
OK; I'll take it back; was planning to do it soon anyway. |
Sure, thanks! I'll look into these concepts anyway and look forward for your solution - hopefully I'll be able to have a better understanding of it from the pointers you gave. |
Resolves spring-projects#2222 Re-pause any paused partitions that are re-assigned after a rebalance, Remove any partitions that are revoked and not re-assigned from the paused partitions collections (pause requests and actually paused).
Resolves spring-projects#2222 Re-pause any paused partitions that are re-assigned after a rebalance, Remove any partitions that are revoked and not re-assigned from the paused partitions collections (pause requests and actually paused).
Resolves #2222 Re-pause any paused partitions that are re-assigned after a rebalance, Remove any partitions that are revoked and not re-assigned from the paused partitions collections (pause requests and actually paused).
Resolves #2222 Re-pause any paused partitions that are re-assigned after a rebalance, Remove any partitions that are revoked and not re-assigned from the paused partitions collections (pause requests and actually paused).
Resolves #2222 Re-pause any paused partitions that are re-assigned after a rebalance, Remove any partitions that are revoked and not re-assigned from the paused partitions collections (pause requests and actually paused).
Resolves #2222 Re-pause any paused partitions that are re-assigned after a rebalance, Remove any partitions that are revoked and not re-assigned from the paused partitions collections (pause requests and actually paused).
Hmmm - that's definitely wrong, but I believe it is benign - the field at the concurrent container level is never used, The field should not even exist in the parent container. |
But I am still receiving messages on topic partition "tenant2" although a pause has been requested for that partition. |
Oh - right - I can see that could happen if there are two rebalances. When using Non-blocking retries, the framework will re-pause that partition if the time is not yet satisfied. When manually pausing individual partitions, that won't happen. To satisfy both use cases, we must not remove the partitions from the pause requested list when a rebalance occurs. |
Resolves spring-projects#2350 Do not maintain the `pausePartitionsRequested` field in the concurrent MLC, it is not used and can cause confusion. Also resolves spring-projects#2222 The previous fix removed revoked partitions from `pausePartitionsRequested`; this was incorrect - consider a rebalance where we lose `topic-0` and another rebalance where we are re-assigned `topic-0`. According to the contract, this partition should remain paused. **cherry-pick to 2.9.x, 2.8.x**
Resolves spring-projects#2350 Do not maintain the `pausePartitionsRequested` field in the concurrent MLC, it is not used and can cause confusion. Also resolves spring-projects#2222 The previous fix removed revoked partitions from `pausePartitionsRequested`; this was incorrect - consider a rebalance where we lose `topic-0` and another rebalance where we are re-assigned `topic-0`. According to the contract, this partition should remain paused. **cherry-pick to 2.9.x, 2.8.x**
Resolves spring-projects#2350 Do not maintain the `pausePartitionsRequested` field in the concurrent MLC, it is not used and can cause confusion. Also fixes some synchronization around `CMLC.containers`. Also resolves spring-projects#2222 The previous fix removed revoked partitions from `pausePartitionsRequested`; this was incorrect - consider a rebalance where we lose `topic-0` and another rebalance where we are re-assigned `topic-0`. According to the contract, this partition should remain paused. **cherry-pick to 2.9.x, 2.8.x**
Hello @garyrussell, thanks, in the meantime, can I loop over all KMLCs and call |
Yes, if you add a |
It's probably best to do it via the |
I am using |
Resolves #2350 Do not maintain the `pausePartitionsRequested` field in the concurrent MLC, it is not used and can cause confusion. Also fixes some synchronization around `CMLC.containers`. Also resolves #2222 The previous fix removed revoked partitions from `pausePartitionsRequested`; this was incorrect - consider a rebalance where we lose `topic-0` and another rebalance where we are re-assigned `topic-0`. According to the contract, this partition should remain paused. **cherry-pick to 2.9.x, 2.8.x**
Resolves #2350 Do not maintain the `pausePartitionsRequested` field in the concurrent MLC, it is not used and can cause confusion. Also fixes some synchronization around `CMLC.containers`. Also resolves #2222 The previous fix removed revoked partitions from `pausePartitionsRequested`; this was incorrect - consider a rebalance where we lose `topic-0` and another rebalance where we are re-assigned `topic-0`. According to the contract, this partition should remain paused. **cherry-pick to 2.9.x, 2.8.x**
Resolves #2350 Do not maintain the `pausePartitionsRequested` field in the concurrent MLC, it is not used and can cause confusion. Also fixes some synchronization around `CMLC.containers`. Also resolves #2222 The previous fix removed revoked partitions from `pausePartitionsRequested`; this was incorrect - consider a rebalance where we lose `topic-0` and another rebalance where we are re-assigned `topic-0`. According to the contract, this partition should remain paused. **cherry-pick to 2.9.x, 2.8.x**
If individual partitions are paused (by
@RetryableTopic
or by users), they will be resumed by a rebalance.While this is not really a problem for
@RetryableTopic
, because the partition will be automatically paused again, but it is a problem for user-paused partitions.We already handle this case when the whole container is paused, we need something similar for paused partitions.
spring-kafka/spring-kafka/src/main/java/org/springframework/kafka/listener/KafkaMessageListenerContainer.java
Lines 3272 to 3276 in 0278465
The text was updated successfully, but these errors were encountered: