Consolidate two disk util rebalance prechecks into one - #19176
Consolidate two disk util rebalance prechecks into one#19176J-HowHuang wants to merge 5 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.98% +1.27%
Complexity 1423 1423
============================================
Files 3439 3453 +14
Lines 218064 218948 +884
Branches 34679 34805 +126
============================================
+ Hits 143289 146658 +3369
+ Misses 63226 60570 -2656
- Partials 11549 11720 +171
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.
There was a problem hiding this comment.
In that case it would also fall into "unsafe AFTER rebalance", and will have the message of that.
| // 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?
There was a problem hiding this comment.
This is possible but in reality it should be pretty rare, because in lowDiskMode rebalancer first updates the IS with offload only and wait. No loading (segment added) is involved in this pass, so all of them should be completed in a short time, unless the rebalance config sets the wait timeout to 0 or a very small number.
Other than this risk, I think rebalance with both bestEfforts and lowDiskMode is a valid usage. Adding message here might confuse users that's my concern.
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