Uh oh!
There was an error while loading. Please reload this page.
HBASE-25836 RegionStates#getAssignmentsForBalancer should only care about OPEN or OPENING regions - #3219
Conversation
apurtell
commented
May 2, 2021
Tested in an integration cluster test scenario (see #3208) but let's see what the unit test results in the CR report looks like. |
Apache-HBase
commented
May 2, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 3, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 3, 2021
🎊 +1 overall
This message was automatically generated. |
Uh oh!
There was an error while loading. Please reload this page.
| // to be online at that server until possibly the next balancer iteration or unless | ||
| // we decide to move it. Other states are not interesting as the region will either | ||
| // be closing, or splitting/merging, or will not be deployed. | ||
| if (!(node.isInState(State.OPEN)||node.isInState(State.OPENING))) { |
There was a problem hiding this comment.
nit: spaces missing on either side of ||
or can be simplified to !node.isInState(State.OPEN, State.OPENING)
virajjasani
left a comment
There was a problem hiding this comment.
Except for existing comments, changes look good
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
apurtell
commented
May 3, 2021
Updated after feedback |
apurtell
commented
May 3, 2021
Update the new comment in RegionStates to be more clear. |
apurtell
commented
May 3, 2021
Whitespace fix. |
virajjasani
left a comment
There was a problem hiding this comment.
Left one nit reg log placeholder, else good to go
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
…bout OPEN or OPENING regions RegionStates#getAssignmentsForBalancer is used by the HMaster to collect all regions of interest to the balancer for the next chore iteration. We check if a table is in disabled state to exclude regions that will not be of interest (because disabled regions are or will be offline) or are in a state where they shouldn't be mutated (like SPLITTING). The current checks are not actually comprehensive. Filter out regions not in OPEN or OPENING state when building the set of interesting regions for the balancer to consider. Only regions open (or opening) on the cluster are of interest to balancing calculations for the current iteration. Regions in all other states can be expected to not be of interest – either offline (OFFLINE, or FAILED_*), not subject to balancer decisions now (SPLITTING, SPLITTING_NEW, MERGING, MERGING_NEW), or will be offline shortly (CLOSING) – until at least the next chore iteration. Add TRACE level logging.
apurtell
commented
May 3, 2021
Address @virajjasani 's comment |
| // decides to move it. Regions in other states are not eligible for balancing, because | ||
| // they are closing, splitting, merging, or otherwise already in transition. | ||
| if (!node.isInState(State.OPEN, State.OPENING)) { | ||
| if (LOG.isTraceEnabled()) { |
There was a problem hiding this comment.
Doing both isTraceEnabled() check and parameterized logging seems wasteful, its usually either one or the other.. I think the recommendation from log4j is to do the latter for concise code and avoid unnecessary temporary string objects...
Apache-HBase
commented
May 3, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 3, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 3, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 3, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 3, 2021
🎊 +1 overall
This message was automatically generated. |
Apache-HBase
commented
May 3, 2021
🎊 +1 overall
This message was automatically generated. |
…bout OPEN or OPENING regions (#3219) RegionStates#getAssignmentsForBalancer is used by the HMaster to collect all regions of interest to the balancer for the next chore iteration. We check if a table is in disabled state to exclude regions that will not be of interest (because disabled regions are or will be offline) or are in a state where they shouldn't be mutated (like SPLITTING). The current checks are not actually comprehensive. Filter out regions not in OPEN or OPENING state when building the set of interesting regions for the balancer to consider. Only regions open (or opening) on the cluster are of interest to balancing calculations for the current iteration. Regions in all other states can be expected to not be of interest – either offline (OFFLINE, or FAILED_*), not subject to balancer decisions now (SPLITTING, SPLITTING_NEW, MERGING, MERGING_NEW), or will be offline shortly (CLOSING) – until at least the next chore iteration. Add TRACE level logging. Signed-off-by: Bharath Vissapragada <bharathv@apache.org> Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
…bout OPEN or OPENING regions (#3219) RegionStates#getAssignmentsForBalancer is used by the HMaster to collect all regions of interest to the balancer for the next chore iteration. We check if a table is in disabled state to exclude regions that will not be of interest (because disabled regions are or will be offline) or are in a state where they shouldn't be mutated (like SPLITTING). The current checks are not actually comprehensive. Filter out regions not in OPEN or OPENING state when building the set of interesting regions for the balancer to consider. Only regions open (or opening) on the cluster are of interest to balancing calculations for the current iteration. Regions in all other states can be expected to not be of interest – either offline (OFFLINE, or FAILED_*), not subject to balancer decisions now (SPLITTING, SPLITTING_NEW, MERGING, MERGING_NEW), or will be offline shortly (CLOSING) – until at least the next chore iteration. Add TRACE level logging. Signed-off-by: Bharath Vissapragada <bharathv@apache.org> Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Viraj Jasani <vjasani@apache.org>
RegionStates#getAssignmentsForBalancer is used by the HMaster to collect all regions of interest to the balancer for the next chore iteration. We check if a table is in disabled state to exclude regions that will not be of interest (because disabled regions are or will be offline) or are in a state where they shouldn't be mutated (like SPLITTING).
The current checks are not actually comprehensive. For example, splitting states are considered, but not merging.
Filter out regions not in OPEN or OPENING state when building the set of interesting regions for the balancer to consider. Only regions open (or opening) on the cluster are of interest to balancing calculations for the current iteration. Regions in all other states can be expected to not be of interest – either offline (OFFLINE, or FAILED_*), not subject to balancer decisions now (SPLITTING, SPLITTING_NEW, MERGING, MERGING_NEW), or will be offline shortly (CLOSING) – until at least the next chore iteration.