-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[improve][broker] Explicitly close LB internal topics when playing a follower (ExtensibleLoadManagerImpl only) #23144
Conversation
@heesung-sn Please add the following content to your PR description and select a checkbox:
|
…bleLoadManagerImpl only)
3cf89c4
to
80d1187
Compare
What is an internal topic conflict? What is the impact of it? How does it get resolved if the topic wouldn't be closed (before this PR)? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #23144 +/- ##
============================================
+ Coverage 73.57% 74.54% +0.96%
- Complexity 32624 34097 +1473
============================================
Files 1877 1919 +42
Lines 139502 144252 +4750
Branches 15299 15773 +474
============================================
+ Hits 102638 107532 +4894
+ Misses 28908 28485 -423
- Partials 7956 8235 +279
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Internal topics ownership conflict is concern here when the leadership changes frequently - we should make sure only the current leader owns these internal topics. The persistent internal topic can self-resolve this topic ownership conflict by the ledger fencing logic. However, I think the non-persistent internal topics can be problem because the fencing logic doesn't apply to non-persistent topics. To gracefully release the previous ownership of these internal topics, I think we better make followers explicitly close the internal topics - when leadership changes, there might be a chance that some clients reconnect to the old leader if the connected zk and the old leader's zk are slow. Then, when the old leader zk catches up(notifies a follower signal to the old leader), the old leader should make sure to close any internal topics and its client connections, if any. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
…follower (ExtensibleLoadManagerImpl only) (apache#23144) (cherry picked from commit 1b43b9d) (cherry picked from commit 1e1860a)
…follower (ExtensibleLoadManagerImpl only) (apache#23144) (cherry picked from commit 1b43b9d) (cherry picked from commit 1e1860a)
…follower (ExtensibleLoadManagerImpl only) (apache#23144)
Motivation
Internal topics ownership conflict is a concern here when the leadership changes frequently - we should make sure only the current leader owns these internal topics.
The persistent internal topic can self-resolve this topic ownership conflict by the ledger fencing logic.
However, I think the non-persistent internal topics can be a problem because the fencing logic doesn't apply to non-persistent topics.
To gracefully release the previous ownership of these internal topics, I think we better make followers explicitly close the internal topics - when leadership changes, there might be a chance that some clients reconnect to the old leader if the connected zk and the old leader's zk are slow. Then, when the old leader zk catches up(notifies a follower signal to the old leader), the old leader should make sure to close any internal topics and its client connections, if any.
Modifications
Verifying this change
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
doc
doc-required
doc-not-needed
doc-complete
Matching PR in forked repository
PR in forked repository: