-
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
[fix][broker] Fix the bug that elected leader thinks it's a follower #23138
Conversation
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.
Good catch and good work @heesung-sn! LGTM
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #23138 +/- ##
============================================
+ Coverage 73.57% 74.56% +0.99%
- Complexity 32624 33576 +952
============================================
Files 1877 1919 +42
Lines 139502 144174 +4672
Branches 15299 15758 +459
============================================
+ Hits 102638 107504 +4866
+ Misses 28908 28436 -472
- Partials 7956 8234 +278
Flags with carried forward coverage won't be shown. Click here to find out more.
|
…pache#23138) (cherry picked from commit 3560ddb) (cherry picked from commit 90d17e8)
…pache#23138) (cherry picked from commit 3560ddb) (cherry picked from commit 90d17e8)
…pache#23138) (cherry picked from commit 3560ddb)
Fixes #23125
Motivation
As reported in the issue, #23125, we have seen a case where the elected leader indefinitely thinks it's a follower. As a result, this issue can block load shedding(run by the leader) and cause broker load imbalance.
Additionally, I think the broker leadership should be checked more aggressively upon zk re-connection as well because znode deletion watch events could be missed while reconnected[1]
Refs:
[1] https://zookeeper.apache.org/doc/current/zookeeperProgrammers.html#ch_zkWatches
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: heesung-sn#77