Skip to content

[fix][load-balancer] skip mis-configured resource usage(>100%) in load balancer - #16937

Merged
codelipenghui merged 1 commit into
apache:masterfrom
heesung-sohn:fix-resource-scale
Aug 11, 2022
Merged

codelipenghui merged 1 commit into
apache:masterfrom
heesung-sohn:fix-resource-scale

Conversation

@heesung-sohn

Copy link
Copy Markdown
Contributor

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

  • 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)

  • 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)

@github-actions github-actions Bot added the doc-not-needed Your PR changes do not impact docs label Aug 3, 2022
if (minimumThroughputToOffload < minThroughputThreshold) {
if (log.isDebugEnabled()) {
log.debug("[{}] broker is planning to shed throughput {} MByte/s less than "
if (sampleLog) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about use log.info directly since sampleLog maybe miss some log ?

@heesung-sohn heesung-sohn Aug 4, 2022 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@codelipenghui codelipenghui added this to the 2.12.0 milestone Aug 4, 2022
@codelipenghui

Copy link
Copy Markdown
Contributor

/pulsarbot run-failure-checks

1 similar comment
@heesung-sohn

Copy link
Copy Markdown
Contributor Author

/pulsarbot run-failure-checks

@heesung-sohn

Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

1 similar comment
@heesung-sohn

Copy link
Copy Markdown
Contributor Author

/pulsarbot rerun-failure-checks

@codelipenghui
codelipenghui merged commit eb833e6 into apache:master Aug 11, 2022
@Technoboy- Technoboy- modified the milestones: 2.12.0, 2.11.0 Aug 11, 2022
Technoboy- pushed a commit that referenced this pull request Aug 11, 2022
Technoboy- pushed a commit to merlimat/pulsar that referenced this pull request Aug 16, 2022
@mattisonchao

mattisonchao commented Aug 25, 2022 •

Copy link
Copy Markdown
Member

Hi @heesung-sn
It looks like we have many conflicts when cherry-picking, could you please help push a PR to branch-2.9?

@heesung-sohn

Copy link
Copy Markdown
Contributor Author

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: #17285

Demogorgon314 pushed a commit that referenced this pull request Sep 1, 2022
…100%) in load computation (#16937) (#17285)

### Motivation

cherry-pick this commit to branch-2.9 requested by : #16937 (comment)
Jason918 pushed a commit that referenced this pull request Sep 4, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Sep 16, 2022
…d computation (apache#16937)

(cherry picked from commit eb833e6)
(cherry picked from commit 688fb76)
dragonls pushed a commit to dragonls/pulsar that referenced this pull request Oct 21, 2022
Technoboy- added a commit to Technoboy-/pulsar that referenced this pull request Nov 27, 2022
liangyepianzhou added a commit that referenced this pull request Dec 14, 2022
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 10, 2023
…) in load computation (apache#16937)"

This reverts commit 688fb76.

(cherry picked from commit 76d48c3)
nicoloboschi pushed a commit to datastax/pulsar that referenced this pull request Jan 11, 2023
…) in load computation (apache#16937)"

This reverts commit 688fb76.

(cherry picked from commit 76d48c3)
@heesung-sohn
heesung-sohn deleted the fix-resource-scale branch April 2, 2024 17:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/broker cherry-picked/branch-2.10 cherry-picked/branch-2.11 doc-not-needed Your PR changes do not impact docs release/2.10.2 type/bug The PR fixed a bug or issue reported a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants