KAFKA-12495: Improve rebalance allocation algorithm#1
Conversation
|
This is ready for review now, but I've marked it as a draft to signal that it should not be merged into the upstream branch yet. I'm hoping we can review this PR separately until it's approved to be merged into the trunk branch of the upstream repo, then merge it and the upstream KAFKA-12495 branch together into trunk all at once. |
vamossagar12
left a comment
There was a problem hiding this comment.
@C0urante , Thanks for the follow up PR! I have a few comments mainly for my understanding and some naming related stuffs which I felt could change
C0urante
left a comment
There was a problem hiding this comment.
Thanks @vamossagar12, this is ready for another round when you have time. I've also removed some now-unused methods, as a minor cleanup step.
Thanks @C0urante . I made another pass. |
|
Thanks @vamossagar12. Ready for the next round when you have time. |
|
@C0urante , I looked at it again. The changes look good to me and can't think of new comments at this point. Thanks for the changes ! |
|
Thanks @vamossagar12! @showuon if you can spare a few cycles, mind taking a look? Once this is ready to go we should be able to finally merge a fix for KAFKA-12495! |
|
Sorry, quite busy these days. I'll try to review it next week. |
There was a problem hiding this comment.
I think we can add a comment above this for loop to mention we're going to calculate how many connectors/tasks to revoke from existing worker
There was a problem hiding this comment.
Due to optimizations in the allocation algorithm, we no longer perform a task-balancing revocation in the fourth round, which allows us to reset the delay.
There was a problem hiding this comment.
Just want to confirm if we don't have this patch, this test will fail in apache#12561 , right?
There was a problem hiding this comment.
I don't have preference here, but we changed the variable name from newSubmissions to created, should we also update the comment?
There was a problem hiding this comment.
I don't understand this comment:
Any workers that left the group within the scheduled rebalance delay permanently left the group.
The word permanently seems to be confusing to me.
There was a problem hiding this comment.
TBH, the javadoc can be more clear if we remove all these 3 bullets, because I felt more confused after reading these 3 bullets. So, maybe change to:
Revoke connectors and tasks from each worker in the cluster until no worker is running more than it would be
WDYT?
There was a problem hiding this comment.
Fine with simplifying this 👍
I updated it to Revoke connectors and tasks from each worker in the cluster until no worker is running more than it would be with a perfectly-balanced assignment.; LMKWYT
|
Thanks @showuon! Pushed a new commit; ready when you have time. |
|
Thanks for your time @showuon ! @C0urante , how do we want to take this further? Merge this into my branch and merge that or you want to create another PR against trunk and merge the 2 of them together? I guess it would be better to do the latter to highlight the great improvements you have made here (former might be simpler I reckon) |
|
Merge it into this branch, and check the jenkins build status |
|
@showuon , Chris had a different idea I think => Would wait for his response. |
|
@vamossagar12 it's fine to merge this one now :) |
c7bf4d8 to
71297c3
Compare
b4fb6fc to
3eb5e13
Compare
|
@C0urante done! Thanks for your contribution on this one! |
This change introduces some basic clean up and refactoring for forthcoming commits related to the revised fetch code for the consumer threading refactor project. Reviewers: Christo Lolov <lolovc@amazon.com>, Jun Rao <junrao@gmail.com>
Follow-up as discussed on the open PR for KAFKA-12495, which ports some changes from apache#12019 onto that PR branch.
These changes should fix some issues with load-balancing revocations and assignment of new and lost connectors and tasks. The primary differences are when load-balancing revocations take place (a number of currently-missed cases are added), when lost assignments are reassigned, and how load-balancing revocations are calculated.
One result is that a number of unnecessary follow-up rebalances are skipped since a balanced allocation can be achieved sooner, and potential regressions introduced in the upstream PR for KAFKA-12495 are avoided as a result.
Another result is that resizing connectors should no longer lead to unbalanced allocations across the cluster during rebalance.
Committer Checklist (excluded from commit message)