[improve] [broker] Follower do not need to retrieve load data in zk.#20970
Open
thetumbled wants to merge 4 commits into
Open
[improve] [broker] Follower do not need to retrieve load data in zk.#20970thetumbled wants to merge 4 commits into
thetumbled wants to merge 4 commits into
Conversation
Contributor
|
I support the idea, in large cluster deployment follower read zk is very heavy. We need more unit test on failover or other logic if we remove the retrieve logic. |
Member
Author
|
PTAL, thanks. @codelipenghui @heesung-sn @Demogorgon314 |
Contributor
Can we confirm that followers never use any of this info in their logic(any regressions caused by this change)? |
| // Executor is shutting down | ||
| if (isLeader()) { | ||
| try { | ||
| scheduler.submit(ModularLoadManagerImpl.this::updateAll); |
Member
There was a problem hiding this comment.
We need a unit test to verify this change.
|
The pr had no activity for 30 days, mark with Stale label. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Load balance module in pulsar broker pose greate pressure on zk.


Currently,
ModularLoadManagerImplis the mainLoadManagerin 2.x version, which work as a centralized way. Most of the time, leader broker take the responsibility of shedding and assignning, while followers update their load data to zk for leader. Leader broker retrieve load data of all brokers in the cluster to make decision.But, i found that not only leader will retrieve all load data (include LocalBrokerData and BundleData), but also followers, which is unnecessary and pose greate pressure to zk.
Modifications
Disable load data retrieve for followers.
Result as follows, only the zk instance that serve for leader broker present high throught.


The peak total read traffic of the zk cluster has decreased from 24kb/s to 10kb/s.
Verifying this change
(Please pick either of the following options)
This change is already covered by existing tests, such as (please describe tests).
Does this pull request potentially affect one of the following parts:
If the box was checked, please highlight the changes
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: thetumbled#23