[fix][broker] Fix incorrect Nic usage collected by pulsar - #18882
Merged
Conversation
Member
|
Sorry, I missed this PR. could you follow this change? #18883 Because from the kernel document, not only |
Member
Author
ok. |
Codecov Report
@@ Coverage Diff @@
## master #18882 +/- ##
============================================
+ Coverage 46.17% 46.76% +0.59%
- Complexity 10359 10500 +141
============================================
Files 703 703
Lines 68845 68870 +25
Branches 7382 7384 +2
============================================
+ Hits 31788 32208 +420
+ Misses 33448 33051 -397
- Partials 3609 3611 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Technoboy-
approved these changes
Dec 14, 2022
mattisonchao
approved these changes
Dec 14, 2022
Technoboy-
pushed a commit
to Technoboy-/pulsar
that referenced
this pull request
Dec 14, 2022
4 tasks
lifepuzzlefun
pushed a commit
to lifepuzzlefun/pulsar
that referenced
this pull request
Jan 10, 2023
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.
Fixes #18881 #18881
Motivation
When retrieve all paths of physical NICs, it did not filter those NICs whose state are down.

org.apache.pulsar.broker.loadbalance.LinuxInfoUtils#getPhysicalNICsAs a consequence, we will get a wrong limit value of NIC if

loadBalancerOverrideBrokerNicSpeedGbpsis enabled.for example, we have 4 physical nics, but only eth0 and eth1 is enable, and both of their speed is 10Gbps.
So, the correct limit value of NIC is 20Gbps, that is 20000000 Kbps. But the limit value collected by pulsar is 40Gbps, that is 40000000 Kbps. this is caused by the bug described above.
Modifications
filter those NICs who are unusable.
Verifying this change
This change is already covered by existing tests, such as (please describe tests).
Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: thetumbled#7