-
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] Remove useless load balancer items about MemoryResourceWeight #19559
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.
LGTM
Codecov Report
@@ Coverage Diff @@
## master #19559 +/- ##
=============================================
+ Coverage 28.70% 62.40% +33.69%
- Complexity 6986 25878 +18892
=============================================
Files 1670 1844 +174
Lines 125950 135279 +9329
Branches 13728 14875 +1147
=============================================
+ Hits 36159 84418 +48259
+ Misses 84392 43103 -41289
- Partials 5399 7758 +2359
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
Please discuss this change on the mailing list. This is a fundamental change.
I don't think it is a fundamental change. pulsar/pulsar-common/src/main/java/org/apache/pulsar/policies/data/loadbalancer/LocalBrokerData.java Lines 239 to 243 in 660525e
pulsar/pulsar-common/src/main/java/org/apache/pulsar/policies/data/loadbalancer/LocalBrokerData.java Lines 253 to 259 in 660525e
|
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.
Should we deprecated the config loadBalancerMemoryResourceWeight
first? Or change its default value = 0.
Thanks for the references. This justification would have been very helpful to provide in the PR description. I missed #17598, which made the inconsistent change that you reference. Before #17598, we used memory for both methods. That change could certainly have had a note on the mailing list since it is a fundamental change to how the load balancer works. This change will affect the Interestingly, #17598 addresses the content of this PR and also addresses @Jason918's comment:
However, from what I see, |
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.
Should we deprecated the config
loadBalancerMemoryResourceWeight
first? Or change its default value = 0.
I think this is the right direction to take with this PR in order to make sure that we do not break user implementations.
pulsar-common/src/main/java/org/apache/pulsar/policies/data/loadbalancer/LocalBrokerData.java
Outdated
Show resolved
Hide resolved
I agree that we should not remove the methods but deprecated them. |
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. I think we might want to update some additional documentation, though.
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ThresholdShedder.java
Show resolved
Hide resolved
pulsar-common/src/main/java/org/apache/pulsar/policies/data/loadbalancer/LocalBrokerData.java
Show resolved
Hide resolved
…, LeastLongTermMessageRate, ModularLoadManagerImpl. (#22889) Implementation PR: #22888 ### Motivation Initially, we introduce `loadBalancerCPUResourceWeight`, `loadBalancerBandwidthInResourceWeight`, `loadBalancerBandwidthOutResourceWeight`, `loadBalancerMemoryResourceWeight`, `loadBalancerDirectMemoryResourceWeight` in `ThresholdShedder` to control the resource weight for different resources when calculating the load of the broker. Then we let it work for `LeastResourceUsageWithWeight` for better bundle placement policy. But #19559 and #21168 have point out that the actual load of the broker is not related to the memory usage and direct memory usage, thus we have changed the default value of `loadBalancerMemoryResourceWeight`, `loadBalancerDirectMemoryResourceWeight` to 0.0. There are still some places where memory usage and direct memory usage are used to calculate the load of the broker, such as `OverloadShedder`, `LeastLongTermMessageRate`, `ModularLoadManagerImpl`. We should let the resource weight work for these places so that we can set the resource weight to 0.0 to avoid the impact of memory usage and direct memory usage on the load of the broker. ### Modifications - Let resource weight work for `OverloadShedder`, `LeastLongTermMessageRate`, `ModularLoadManagerImpl`.
Motivation
Even for a Broker with a very low load, its memory will grow slowly until GC is triggered. If memory is used as a load calculation item, the Bundle will be unloaded by mistake
Modifications
Remove memory as load calculation item
Verifying this change
Existing unit tests need to pass all
315157973#5
Documentation
doc
doc-required
doc-not-needed
doc-complete