[bugfix] Fix bug with PERCENT_SEGMENTS_AVAILABLE metric rounding down#10348
Merged
Jackie-Jiang merged 2 commits intoapache:masterfrom Mar 1, 2023
aidar-stripe:aidar-st-percent_segments_available_fix
Merged
[bugfix] Fix bug with PERCENT_SEGMENTS_AVAILABLE metric rounding down#10348Jackie-Jiang merged 2 commits intoapache:masterfrom aidar-stripe:aidar-st-percent_segments_available_fix
Jackie-Jiang merged 2 commits intoapache:masterfrom
aidar-stripe:aidar-st-percent_segments_available_fix
Conversation
Contributor
Jackie-Jiang
left a comment
There was a problem hiding this comment.
Good catch. Can you take a look at the test failures?
pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java
Outdated
Show resolved
Hide resolved
…ix/SegmentStatusChecker.java Co-authored-by: Xiaotian (Jackie) Jiang <17555551+Jackie-Jiang@users.noreply.github.com>
Contributor
Author
I'm not quite sure why some tests end up failing, it's also different set of tests that fail when I run maven locally. Let's see how successful they are after this change. |
Codecov Report
@@ Coverage Diff @@
## master #10348 +/- ##
=============================================
+ Coverage 32.05% 70.33% +38.28%
- Complexity 236 5940 +5704
=============================================
Files 2029 2035 +6
Lines 109970 110228 +258
Branches 16711 16748 +37
=============================================
+ Hits 35253 77532 +42279
+ Misses 71563 27270 -44293
- Partials 3154 5426 +2272
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Jackie-Jiang
approved these changes
Mar 1, 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.
Description
For tables that have high number of segments PERCENT_SEGMENTS_AVAILABLE reports 100% availability despite a few replicas being offline. Caused by rounding down
(nOffline * 100 / nSegments)tointbefore subtraction from 100.This PR changes metric logic to properly round down PERCENT_SEGMENTS_AVAILABLE and report 99% availability in such scenarios.
Testing