Skip to content

HBASE-26989 TestStochasticLoadBalancer fixes for performance and consistency - #4385

Merged
apurtell merged 4 commits into
apache:masterfrom
d-c-manning:HBASE-26989
May 2, 2022
Merged

HBASE-26989 TestStochasticLoadBalancer fixes for performance and consistency#4385
apurtell merged 4 commits into
apache:masterfrom
d-c-manning:HBASE-26989

Conversation

@d-c-manning

@d-c-manningd-c-manning commented Apr 29, 2022

Copy link
Copy Markdown
Contributor

HBASE-26989

When running the tests locally, I see these runtime improvements:
testNeedBalance: from 120 seconds to 11 seconds
testSloppyTablesLoadBalanceByTable 27 seconds to <1 second
testBalanceOfSloppyServers 67 seconds to <1 second

I ran testNeedBalance 100 times locally, and the other two tests I ran 1000 times locally.

So total class TestStochasticLoadBalancer runtime reduces from 230 seconds to 31 seconds.

Additionally, we get more deterministic behavior, since tests are more likely to have consistent results with a max number of steps when compared to a max running time.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 42sDocker mode activated.
_ Prechecks _
+1 💚dupname0m 0sNo case conflicting files found.
+1 💚hbaseanti0m 0sPatch does not have any anti-patterns.
+1 💚@author0m 0sThe patch does not contain any @author tags.
_ master Compile Tests _
+1 💚mvninstall3m 27smaster passed
+1 💚compile0m 19smaster passed
+1 💚checkstyle0m 11smaster passed
+1 💚spotbugs0m 22smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 2sthe patch passed
+1 💚compile0m 17sthe patch passed
+1 💚javac0m 17sthe patch passed
+1 💚checkstyle0m 7sthe patch passed
+1 💚whitespace0m 0sThe patch has no whitespace issues.
+1 💚hadoopcheck11m 34sPatch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚spotbugs0m 24sthe patch passed
_ Other Tests _
+1 💚asflicense0m 8sThe patch does not generate ASF License warnings.
24m 22s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/1/artifact/yetus-general-check/output/Dockerfile
GITHUB PR#4385
Optional Testsdupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile
unameLinux 1c06aa21544d 5.4.0-1071-aws #76~18.04.1-Ubuntu SMP Mon Mar 28 17:49:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / f4eb907
Default JavaAdoptOpenJDK-1.8.0_282-b08
Max. process+thread count64 (vs. ulimit of 30000)
modulesC: hbase-balancer U: hbase-balancer
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/1/console
versionsgit=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec1m 1sDocker mode activated.
-0 ⚠️yetus0m 4sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall2m 21smaster passed
+1 💚compile0m 13smaster passed
+1 💚shadedjars3m 41sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 14smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 13sthe patch passed
+1 💚compile0m 14sthe patch passed
+1 💚javac0m 14sthe patch passed
+1 💚shadedjars3m 37spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 11sthe patch passed
_ Other Tests _
+1 💚unit10m 8shbase-balancer in the patch passed.
24m 44s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/1/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#4385
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 40f00637096b 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / f4eb907
Default JavaAdoptOpenJDK-1.8.0_282-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/1/testReport/
Max. process+thread count161 (vs. ulimit of 30000)
modulesC: hbase-balancer U: hbase-balancer
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec0m 34sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall2m 40smaster passed
+1 💚compile0m 11smaster passed
+1 💚shadedjars3m 50sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 18smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 29sthe patch passed
+1 💚compile0m 12sthe patch passed
+1 💚javac0m 12sthe patch passed
+1 💚shadedjars3m 48spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 10sthe patch passed
_ Other Tests _
+1 💚unit9m 51shbase-balancer in the patch passed.
24m 48s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/1/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4385
Optional Testsjavac javadoc unit shadedjars compile
unameLinux a59fe2b04223 5.4.0-1071-aws #76~18.04.1-Ubuntu SMP Mon Mar 28 17:49:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / f4eb907
Default JavaAdoptOpenJDK-11.0.10+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/1/testReport/
Max. process+thread count193 (vs. ulimit of 30000)
modulesC: hbase-balancer U: hbase-balancer
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/1/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

//reset config
conf.setFloat("hbase.master.balancer.stochastic.minCostNeedBalance", minCost);
conf.unset(HConstants.HBASE_MASTER_LOADBALANCE_BYTABLE);
conf.setBoolean(HConstants.HBASE_MASTER_LOADBALANCE_BYTABLE, oldIsByTable);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@d-c-manning Instead of resetting the conf object in every method's finally block, can we reset the conf object to some default values in a method which is annotated After ?

@d-c-manningd-c-manningApr 29, 2022

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@shahrs87 I can try that. I would probably try it in the base class with a @Before annotation to ensure that we restore state before each test. That is sort of in line with the @BeforeClass that currently exists. It will make the PR much bigger, though, as this style of conf updates pre-exists my tests.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

It would require #4384 but since that is merged now, I guess we can try.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

I couldn't put it in the base class, because other subclasses override the beforeAllTests with their own BeforeClass version. It's probably for the best anyway, to keep the scope of the change more limited.

Copy link
Copy Markdown
ContributorAuthor

Choose a reason for hiding this comment

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

@shahrs87 I made the change. It's best viewed by using the "hide whitespace" feature in github, because of the removal of try blocks. I think it cleans up this test class nicely, even though it's a bigger scoped change. Thanks for the recommendation!

@shahrs87shahrs87 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

+1 assuming jenkins is green. Thank you @d-c-manning

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec3m 50sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall2m 45smaster passed
+1 💚compile0m 12smaster passed
+1 💚shadedjars3m 52sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 13smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 34sthe patch passed
+1 💚compile0m 12sthe patch passed
+1 💚javac0m 12sthe patch passed
+1 💚shadedjars3m 49spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 9sthe patch passed
_ Other Tests _
+1 💚unit9m 50shbase-balancer in the patch passed.
28m 7s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/2/artifact/yetus-jdk11-hadoop3-check/output/Dockerfile
GITHUB PR#4385
Optional Testsjavac javadoc unit shadedjars compile
unameLinux 30f9a3825ade 5.4.0-1071-aws #76~18.04.1-Ubuntu SMP Mon Mar 28 17:49:57 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 4a33ed1
Default JavaAdoptOpenJDK-11.0.10+9
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/2/testReport/
Max. process+thread count196 (vs. ulimit of 30000)
modulesC: hbase-balancer U: hbase-balancer
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/2/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase

Copy link
Copy Markdown

🎊 +1 overall

VoteSubsystemRuntimeComment
+0 🆗reexec6m 8sDocker mode activated.
-0 ⚠️yetus0m 3sUnprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚mvninstall2m 27smaster passed
+1 💚compile0m 14smaster passed
+1 💚shadedjars3m 38sbranch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 13smaster passed
_ Patch Compile Tests _
+1 💚mvninstall2m 13sthe patch passed
+1 💚compile0m 14sthe patch passed
+1 💚javac0m 14sthe patch passed
+1 💚shadedjars3m 38spatch has no errors when building our shaded downstream artifacts.
+1 💚javadoc0m 12sthe patch passed
_ Other Tests _
+1 💚unit10m 10shbase-balancer in the patch passed.
29m 48s
SubsystemReport/Notes
DockerClientAPI=1.41 ServerAPI=1.41 base: https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/2/artifact/yetus-jdk8-hadoop3-check/output/Dockerfile
GITHUB PR#4385
Optional Testsjavac javadoc unit shadedjars compile
unameLinux c271e2c2b461 5.4.0-90-generic #101-Ubuntu SMP Fri Oct 15 20:00:55 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
Build toolmaven
Personalitydev-support/hbase-personality.sh
git revisionmaster / 4a33ed1
Default JavaAdoptOpenJDK-1.8.0_282-b08
Test Resultshttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/2/testReport/
Max. process+thread count161 (vs. ulimit of 30000)
modulesC: hbase-balancer U: hbase-balancer
Console outputhttps://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/2/console
versionsgit=2.17.1 maven=3.6.3
Powered byApache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@apurtell

Copy link
Copy Markdown
Contributor

@d-c-manning Please resolve conflicts and I will merge it.

@apurtell
apurtell merged commit da55154 into apache:masterMay 2, 2022
asfgit pushed a commit that referenced this pull request May 2, 2022
…istency (#4385)
Signed-off-by: Andrew Purtell <apurtell@apache.org>
Reviewed by: Rushabh Shah <shahrs87@gmail.com>
Conflicts:
hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancer.java
asfgit pushed a commit that referenced this pull request May 2, 2022
…istency (#4385)
Signed-off-by: Andrew Purtell <apurtell@apache.org>
Reviewed by: Rushabh Shah <shahrs87@gmail.com>
Conflicts:
hbase-server/src/test/java/org/apache/hadoop/hbase/master/balancer/TestStochasticLoadBalancer.java
@d-c-manning
d-c-manning deleted the HBASE-26989 branch May 2, 2022 20:03
Sign up for freeto 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.

4 participants

@d-c-manning@Apache-HBase@apurtell@shahrs87