Consolidate two disk util rebalance prechecks into one - #19176
Consolidate two disk util rebalance prechecks into one#19176J-HowHuang wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #19176 +/- ##
============================================
+ Coverage 65.70% 66.62% +0.91%
Complexity 1423 1423
============================================
Files 3439 3443 +4
Lines 218064 218584 +520
Branches 34679 34793 +114
============================================
+ Hits 143289 145624 +2335
+ Misses 63226 61231 -1995
- Partials 11549 11729 +180
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
yashmayya
left a comment
There was a problem hiding this comment.
Thanks for the improvement, I've left some comments
| addIfOverThreshold(serversUnsafeDuringRebalance, server, | ||
| (double) (diskUsage.getUsedSpaceBytes() + diskUtilizationGain) / diskUsage.getTotalSpaceBytes(), threshold); |
There was a problem hiding this comment.
We'll be flagging servers where the existing used space is over the threshold even if diskUtilizationGain == 0? Seems wrong to say unsafe DURING rebalance / recommend enabling lowDiskMode which would do nothing in such a scenario.
| // deleted before adding the new ones. It is however only honored by the incremental rebalance path, which downtime | ||
| // skips altogether by replacing the IdealState with the target assignment in one go | ||
| RebalanceConfig rebalanceConfig = preCheckContext.getRebalanceConfig(); | ||
| if (rebalanceConfig.isLowDiskMode() && !rebalanceConfig.isDowntime()) { |
There was a problem hiding this comment.
Should we also check for bestEfforts which seems to also potentially violate lowDiskMode?
There was a problem hiding this comment.
Afaik bestEfforts is orthogonal to lowDiskMode, can you explain your concern?
There was a problem hiding this comment.
If the EV-IS progress stalls, IIUC bestEfforts will cause the rebalance algorithm to give up waiting and just move to the next step which could mean that we add new segments to servers before old ones are actually offloaded?
| // skips altogether by replacing the IdealState with the target assignment in one go | ||
| RebalanceConfig rebalanceConfig = preCheckContext.getRebalanceConfig(); | ||
| if (rebalanceConfig.isLowDiskMode() && !rebalanceConfig.isDowntime()) { | ||
| return RebalancePreCheckerResult.pass(withinThreshold + " AFTER rebalance. Some servers would go over it DURING " |
There was a problem hiding this comment.
Might be useful to log which servers
| } | ||
|
|
||
| private static String getUnsafeDiskUtilizationMessage(String when, List<String> servers, double threshold) { | ||
| return String.format("UNSAFE. Servers with unsafe disk utilization %s (>%d%%): %s", when, (short) (threshold * 100), |
Description
Originally the disk utilization precheck in table rebalance is easily confusing. Reduce the unnecessary information so that it's more intuitive.
Original Behavior
diskUtilizationDuringRebalance: shows the highest disk utilization on each server it could get during the rebalance (i.e. the footprint, the worst case if all segments are added first, then removed)diskUtilizationAfterRebalance: shows the net disk utilization on each server after rebalanceThese checks warn anyway regardless of
lowDiskModeis set or not, where thelowDiskModeconfig is designed to solve the case when the first fails and the second passes.New Behavior
Make it only one
diskUtilizationcheck. Pass when both the originaldiskUtilizationDuringRebalanceanddiskUtilizationAfterRebalancepasses, or onlydiskUtilizationAfterRebalancepasses yetlowDiskMode=true, downtime=false, fail otherwise.Examples
1. Within threshold throughout
2. Over threshold after the rebalance — ERROR regardless of config
3. Over threshold only during the rebalance,
lowDiskMode=false→ ERROR, with the fix named4. Same,
lowDiskMode=true→ PASS, transient peak is ruled out5. Same,
lowDiskMode=trueANDdowntime=true→ still ERROR, because downtime replaces the IdealState in one go and skips the incremental pathlowDiskModeacts on6. Disk usage info not yet collected — unchanged
7.
rebalanceConfigOptionsalso flags the dead combination, even when disk is fine