You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/08/03 22:42:38 UTC
[GitHub] [pulsar] heesung-sn opened a new pull request, #16937: [fix][load-balancer] skip mis-configured resource usage(>100%) in load balancer
heesung-sn opened a new pull request, #16937:
URL: https://github.com/apache/pulsar/pull/16937
<!--
### Contribution Checklist
- PR title format should be *[type][component] summary*. For details, see *[Guideline - Pulsar PR Naming Convention](https://docs.google.com/document/d/1d8Pw6ZbWk-_pCKdOmdvx9rnhPiyuxwq60_TrD68d7BA/edit#heading=h.trs9rsex3xom)*.
- Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
- Each pull request should address only one issue, not mix up code from multiple issues.
- Each commit in the pull request has a meaningful commit message
- Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
**(The sections below can be removed for hotfixes of typos)**
-->
### Motivation
Incorrectly scaled resource load usage(cpu, memory, network usages bigger than 100%) can harm the load computation in the load balancer logics, as the load balancer computation expects all resource usages are normalized to the 100% scale.
Also, we need more logs to debug load balance issues in the production. For example, we need more logs to investigate why the load balancer does not unload the bundles to the underloaded brokers and etc.
### Modifications
- Added a fall-back logic to ignore any incorrectly scaled resource usage in the load balance computation from ThresholdShedder.
- Also updated LeastResourceUsageWithWeight.java (used for broker assignment) to ignore such invalid resource usages.
- Added more logs in load balance logics(ThresholdShedder and Load Report) for better debugging.
### Verifying this change
- [x] Make sure that the change passes the CI checks.
This change is already covered by existing tests, such as ThresholdShedderTest
### Does this pull request potentially affect one of the following parts:
*If `yes` was chosen, please highlight the changes*
- Dependencies (does it add or upgrade a dependency): (yes / no)
- The public API: (yes / **no**)
- The schema: (yes / **no** / don't know)
- The default values of configurations: (yes / **no**)
- The wire protocol: (yes / **no**)
- The rest endpoints: (yes / **no**)
- The admin cli options: (yes / **no**)
- Anything that affects deployment: (yes / **no** / don't know)
### Documentation
Check the box below or label this PR directly.
Need to update docs?
- [ ] `doc-required`
(Your PR needs to update docs and you will update later)
- [x] `doc-not-needed`
(Please explain why) This fix covers the load computation edge case from the Load Balancer.
- [ ] `doc`
(Your PR contains doc changes)
- [ ] `doc-complete`
(Docs have been already added)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] heesung-sn commented on a diff in pull request #16937: [fix][load-balancer] skip mis-configured resource usage(>100%) in load balancer
Posted by GitBox <gi...@apache.org>.
heesung-sn commented on code in PR #16937:
URL: https://github.com/apache/pulsar/pull/16937#discussion_r937326195
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ThresholdShedder.java:
##########
@@ -86,14 +109,13 @@ public Multimap<String, String> findBundlesForUnloading(final LoadData loadData,
double minimumThroughputToOffload = brokerCurrentThroughput * percentOfTrafficToOffload;
if (minimumThroughputToOffload < minThroughputThreshold) {
- if (log.isDebugEnabled()) {
- log.debug("[{}] broker is planning to shed throughput {} MByte/s less than "
+ if (sampleLog) {
Review Comment:
I intentionally sample the logs as this shedding logic computes the load frequently every x min(I think the default is every one minute).
Here, we want to emit logs for every unload decision (as-is) but sample logs for the skip(non-unload) decisions.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui commented on pull request #16937: [fix][load-balancer] skip mis-configured resource usage(>100%) in load balancer
Posted by GitBox <gi...@apache.org>.
codelipenghui commented on PR #16937:
URL: https://github.com/apache/pulsar/pull/16937#issuecomment-1206105608
/pulsarbot run-failure-checks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] heesung-sn commented on pull request #16937: [fix][load-balancer] skip mis-configured resource usage(>100%) in load balancer
Posted by GitBox <gi...@apache.org>.
heesung-sn commented on PR #16937:
URL: https://github.com/apache/pulsar/pull/16937#issuecomment-1210820916
/pulsarbot rerun-failure-checks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] heesung-sn commented on a diff in pull request #16937: [fix][load-balancer] skip mis-configured resource usage(>100%) in load balancer
Posted by GitBox <gi...@apache.org>.
heesung-sn commented on code in PR #16937:
URL: https://github.com/apache/pulsar/pull/16937#discussion_r937326195
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ThresholdShedder.java:
##########
@@ -86,14 +109,13 @@ public Multimap<String, String> findBundlesForUnloading(final LoadData loadData,
double minimumThroughputToOffload = brokerCurrentThroughput * percentOfTrafficToOffload;
if (minimumThroughputToOffload < minThroughputThreshold) {
- if (log.isDebugEnabled()) {
- log.debug("[{}] broker is planning to shed throughput {} MByte/s less than "
+ if (sampleLog) {
Review Comment:
I intentionally sample the logs as this shedding logic computes the load frequently every x min(I think the default is every one minute).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] heesung-sn commented on pull request #16937: [fix][load-balancer] skip mis-configured resource usage(>100%) in load balancer
Posted by GitBox <gi...@apache.org>.
heesung-sn commented on PR #16937:
URL: https://github.com/apache/pulsar/pull/16937#issuecomment-1227667430
> Hi @heesung-sn It looks like we have many conflicts when cherry-picking, could you please help push a PR to branch-2.9?
Raised a PR: https://github.com/apache/pulsar/pull/17285
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] mattisonchao commented on pull request #16937: [fix][load-balancer] skip mis-configured resource usage(>100%) in load balancer
Posted by GitBox <gi...@apache.org>.
mattisonchao commented on PR #16937:
URL: https://github.com/apache/pulsar/pull/16937#issuecomment-1227036563
Hi @heesung-sn
Could you please help push a PR to branch-2.9?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] HQebupt commented on a diff in pull request #16937: [fix][load-balancer] skip mis-configured resource usage(>100%) in load balancer
Posted by GitBox <gi...@apache.org>.
HQebupt commented on code in PR #16937:
URL: https://github.com/apache/pulsar/pull/16937#discussion_r937282753
##########
pulsar-broker/src/main/java/org/apache/pulsar/broker/loadbalance/impl/ThresholdShedder.java:
##########
@@ -86,14 +109,13 @@ public Multimap<String, String> findBundlesForUnloading(final LoadData loadData,
double minimumThroughputToOffload = brokerCurrentThroughput * percentOfTrafficToOffload;
if (minimumThroughputToOffload < minThroughputThreshold) {
- if (log.isDebugEnabled()) {
- log.debug("[{}] broker is planning to shed throughput {} MByte/s less than "
+ if (sampleLog) {
Review Comment:
How about use `log.info` directly since `sampleLog` maybe miss some log ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] heesung-sn commented on pull request #16937: [fix][load-balancer] skip mis-configured resource usage(>100%) in load balancer
Posted by GitBox <gi...@apache.org>.
heesung-sn commented on PR #16937:
URL: https://github.com/apache/pulsar/pull/16937#issuecomment-1210121420
/pulsarbot run-failure-checks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] heesung-sn commented on pull request #16937: [fix][load-balancer] skip mis-configured resource usage(>100%) in load balancer
Posted by GitBox <gi...@apache.org>.
heesung-sn commented on PR #16937:
URL: https://github.com/apache/pulsar/pull/16937#issuecomment-1210308309
/pulsarbot rerun-failure-checks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [pulsar] codelipenghui merged pull request #16937: [fix][load-balancer] skip mis-configured resource usage(>100%) in load balancer
Posted by GitBox <gi...@apache.org>.
codelipenghui merged PR #16937:
URL: https://github.com/apache/pulsar/pull/16937
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org