-
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] PIP-364: Introduce a new load balance algorithm AvgShedder #22949
Conversation
@thetumbled Please add the following content to your PR description and select a checkbox:
|
As the proposal PR has been merged, we can proceed with the implementation PR, thanks. @lhotari @heesung-sn @Demogorgon314 @BewareMyPower @poorbarcode |
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/AvgShedder.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/AvgShedder.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/AvgShedder.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/AvgShedder.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/AvgShedder.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/AvgShedder.java
Outdated
Show resolved
Hide resolved
…ce/impl/AvgShedder.java Co-authored-by: Kai Wang <kwang@streamnative.io>
…ce/impl/AvgShedder.java Co-authored-by: Kai Wang <kwang@streamnative.io>
…ce/impl/AvgShedder.java Co-authored-by: Kai Wang <kwang@streamnative.io>
…ce/impl/AvgShedder.java Co-authored-by: Yunze Xu <xyzinfernity@163.com>
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.
Besides, the findBundlesForUnloading
method is too long (about 200 lines), which is hard to read. It's worth splitting it into multiple private methods. From what I see, there should be 3 steps:
loadData.getBrokerData()
-> updatedbrokerScoreMap
(Map<String, Double>
) and its sorted keys according to the value comparation- Update
brokerHitCountForLow
andbrokerHitCountForHigh
according to the threshold related configs. - Update and return
selectedBundlesCache
according toloadData.getRecentlyUnloadedBundles()
and the two maps above.
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/AvgShedder.java
Outdated
Show resolved
Hide resolved
Updated, thanks for review! |
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/AvgShedder.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/AvgShedder.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/AvgShedder.java
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/AvgShedder.java
Outdated
Show resolved
Hide resolved
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/AvgShedder.java
Outdated
Show resolved
Hide resolved
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 job! Can you add the AvgShedder
algorithm for ExtensibleLoadManager
.
Sounds good, i will try to acheive that. |
PIP-364: Introduce a new load balance algorithm AvgShedder |
Hi @thetumbled, can you help send a discussion to cherry-pick this new algorithm into |
discussion link: https://lists.apache.org/thread/9yqq8wky1k73hqz6xhvstk6x0ycknqgt |
…edder (apache#22949) Co-authored-by: Kai Wang <kwang@streamnative.io> Co-authored-by: Yunze Xu <xyzinfernity@163.com> (cherry picked from commit c160cc9) Signed-off-by: Zixuan Liu <nodeces@gmail.com>
…edder (apache#22949) Co-authored-by: Kai Wang <kwang@streamnative.io> Co-authored-by: Yunze Xu <xyzinfernity@163.com> (cherry picked from commit c160cc9) Signed-off-by: Zixuan Liu <nodeces@gmail.com>
Tip: If you want to cherry pick this pr, please cherry pick this patch too: |
Motivation
Implementation PR for PIP: #22946.
Modifications
Verifying this change
(Please pick either of the following options)
This change added tests and can be verified as follows:
(example:)
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: thetumbled#59