Skip to content

Conversation

@rmdmattingly
Copy link
Contributor

Because we'll accept any moves that improve conditional violations, this bug can cause us to erroneously approve balancer actions.

@rmdmattingly rmdmattingly requested a review from ndimiduk March 19, 2025 13:11
Comment on lines -148 to 149

if (isViolatingPre && isViolatingPost) {
if (isViolatingPre == isViolatingPost) {
return 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also want to return 0 if we had zero violations both pre & post. Prior to this fix, we'd fall through to return -1 which erroneously considered a neutral move to be an improvement

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this was so impactful to behavior, maybe good to capture this method in a unit test?

Comment on lines -148 to 149

if (isViolatingPre && isViolatingPost) {
if (isViolatingPre == isViolatingPost) {
return 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this was so impactful to behavior, maybe good to capture this method in a unit test?

@Apache-HBase

This comment has been minimized.

@Apache-HBase

This comment has been minimized.

Comment on lines +43 to +50
/**
* If your minCostNeedsBalance is set too low, then the balancer should still eventually stop making
* moves as further cost improvements become impossible, and balancer plan calculation becomes
* wasteful. This test ensures that the balancer will not get stuck in a loop of continuously moving
* regions.
*/
@Category({ MasterTests.class, MediumTests.class })
public class TestUnattainableBalancerCostGoal {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test fails on master atm (if balancer conditionals are enabled). It passes with this patch

Comment on lines -74 to +80
if (balancerRuns > 1000) {
if (balancerRuns > 10) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I validated locally that this change is okay, will see if the tests also pass in CI. If it's taking more than 10 balancer runs for a test, then we should probably increase that tests max run time to make it more efficient

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 32s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
_ master Compile Tests _
+1 💚 mvninstall 3m 26s master passed
+1 💚 compile 0m 27s master passed
+1 💚 checkstyle 0m 10s master passed
+1 💚 spotbugs 0m 27s master passed
+1 💚 spotless 0m 47s branch has no errors when running spotless:check.
_ Patch Compile Tests _
+1 💚 mvninstall 3m 7s the patch passed
+1 💚 compile 0m 25s the patch passed
+1 💚 javac 0m 25s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 0m 8s the patch passed
+1 💚 spotbugs 0m 31s the patch passed
+1 💚 hadoopcheck 12m 6s Patch does not cause any errors with Hadoop 3.3.6 3.4.0.
+1 💚 spotless 0m 45s patch has no errors when running spotless:check.
_ Other Tests _
+1 💚 asflicense 0m 9s The patch does not generate ASF License warnings.
30m 29s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6821/2/artifact/yetus-general-check/output/Dockerfile
GITHUB PR #6821
Optional Tests dupname asflicense javac spotbugs checkstyle codespell detsecrets compile hadoopcheck hbaseanti spotless
uname Linux 65c9c347c535 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 6226730
Default Java Eclipse Adoptium-17.0.11+9
Max. process+thread count 81 (vs. ulimit of 30000)
modules C: hbase-balancer U: hbase-balancer
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6821/2/console
versions git=2.34.1 maven=3.9.8 spotbugs=4.7.3
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 38s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --author-ignore-list --blanks-eol-ignore-file --blanks-tabs-ignore-file --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 4m 2s master passed
+1 💚 compile 0m 30s master passed
+1 💚 javadoc 0m 17s master passed
+1 💚 shadedjars 7m 59s branch has no errors when building our shaded downstream artifacts.
_ Patch Compile Tests _
+1 💚 mvninstall 4m 38s the patch passed
+1 💚 compile 0m 24s the patch passed
+1 💚 javac 0m 24s the patch passed
+1 💚 javadoc 0m 19s the patch passed
+1 💚 shadedjars 8m 1s patch has no errors when building our shaded downstream artifacts.
_ Other Tests _
+1 💚 unit 8m 42s hbase-balancer in the patch passed.
36m 38s
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6821/2/artifact/yetus-jdk17-hadoop3-check/output/Dockerfile
GITHUB PR #6821
Optional Tests javac javadoc unit compile shadedjars
uname Linux 308b0b617a94 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/hbase-personality.sh
git revision master / 6226730
Default Java Eclipse Adoptium-17.0.11+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6821/2/testReport/
Max. process+thread count 269 (vs. ulimit of 30000)
modules C: hbase-balancer U: hbase-balancer
Console output https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-6821/2/console
versions git=2.34.1 maven=3.9.8
Powered by Apache Yetus 0.15.0 https://yetus.apache.org

This message was automatically generated.

Copy link
Member

@ndimiduk ndimiduk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one!

private CandidateGeneratorTestUtil() {
}

enum ExhaustionType {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rmdmattingly rmdmattingly merged commit f1dc2c1 into apache:master Mar 21, 2025
1 check passed
@rmdmattingly rmdmattingly deleted the HBASE-29202 branch March 21, 2025 12:05
rmdmattingly added a commit that referenced this pull request Mar 21, 2025
…o be approved (#6821)

Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
rmdmattingly added a commit that referenced this pull request Mar 21, 2025
…o be approved (#6821)

Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
rmdmattingly added a commit to HubSpot/hbase that referenced this pull request Mar 21, 2025
…o be approved (apache#6821)

Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
rmdmattingly added a commit to HubSpot/hbase that referenced this pull request Mar 21, 2025
…ions more likely to be approved (apache#6821) (will be in 2.7)

Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
rmdmattingly added a commit to HubSpot/hbase that referenced this pull request Mar 21, 2025
…ions more likely to be approved (apache#6821) (will be in 2.7)

Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
rmdmattingly added a commit to HubSpot/hbase that referenced this pull request Mar 21, 2025
…o be approved (apache#6821)

Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
rmdmattingly added a commit that referenced this pull request Mar 21, 2025
…o be approved (#6821) (#6836)

Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
rmdmattingly added a commit that referenced this pull request Mar 21, 2025
…o be approved (#6821)

Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
rmdmattingly added a commit that referenced this pull request Mar 23, 2025
…o be approved (#6821) (#6837)

Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
charlesconnell pushed a commit to HubSpot/hbase that referenced this pull request Jun 25, 2025
…ions more likely to be approved (apache#6821) (will be in 2.7)

Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
charlesconnell pushed a commit to HubSpot/hbase that referenced this pull request Jul 1, 2025
…ions more likely to be approved (apache#6821) (will be in 2.7)

Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
mokai87 pushed a commit to mokai87/hbase that referenced this pull request Aug 7, 2025
…o be approved (apache#6821) (apache#6837)

Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
Co-authored-by: Ray Mattingly <rmattingly@hubspot.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants