Skip to content

Conversation

@d-c-manning
Copy link
Contributor

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

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

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 42s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 hbaseanti 0m 0s Patch does not have any anti-patterns.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
_ master Compile Tests _
+1 💚 mvninstall 3m 27s master passed
+1 💚 compile 0m 19s master passed
+1 💚 checkstyle 0m 11s master passed
+1 💚 spotbugs 0m 22s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 2s the patch passed
+1 💚 compile 0m 17s the patch passed
+1 💚 javac 0m 17s the patch passed
+1 💚 checkstyle 0m 7s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 hadoopcheck 11m 34s Patch does not cause any errors with Hadoop 3.1.2 3.2.2 3.3.1.
+1 💚 spotbugs 0m 24s the patch passed
_ Other Tests _
+1 💚 asflicense 0m 8s The patch does not generate ASF License warnings.
24m 22s
Subsystem Report/Notes
Docker ClientAPI=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 Tests dupname asflicense javac spotbugs hadoopcheck hbaseanti checkstyle compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / f4eb907
Default Java AdoptOpenJDK-1.8.0_282-b08
Max. process+thread count 64 (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-4385/1/console
versions git=2.17.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 1m 1s Docker mode activated.
-0 ⚠️ yetus 0m 4s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 2m 21s master passed
+1 💚 compile 0m 13s master passed
+1 💚 shadedjars 3m 41s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 14s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 13s the patch passed
+1 💚 compile 0m 14s the patch passed
+1 💚 javac 0m 14s the patch passed
+1 💚 shadedjars 3m 37s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 11s the patch passed
_ Other Tests _
+1 💚 unit 10m 8s hbase-balancer in the patch passed.
24m 44s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / f4eb907
Default Java AdoptOpenJDK-1.8.0_282-b08
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/1/testReport/
Max. process+thread count 161 (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-4385/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 34s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 2m 40s master passed
+1 💚 compile 0m 11s master passed
+1 💚 shadedjars 3m 50s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 18s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 29s the patch passed
+1 💚 compile 0m 12s the patch passed
+1 💚 javac 0m 12s the patch passed
+1 💚 shadedjars 3m 48s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 10s the patch passed
_ Other Tests _
+1 💚 unit 9m 51s hbase-balancer in the patch passed.
24m 48s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / f4eb907
Default Java AdoptOpenJDK-11.0.10+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/1/testReport/
Max. process+thread count 193 (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-4385/1/console
versions git=2.17.1 maven=3.6.3
Powered by Apache 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
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 ?

Copy link
Contributor Author

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

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
Contributor Author

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
Contributor Author

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
Contributor Author

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!

Copy link
Contributor

@shahrs87 shahrs87 left a comment

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

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 3m 50s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 2m 45s master passed
+1 💚 compile 0m 12s master passed
+1 💚 shadedjars 3m 52s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 13s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 34s the patch passed
+1 💚 compile 0m 12s the patch passed
+1 💚 javac 0m 12s the patch passed
+1 💚 shadedjars 3m 49s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 9s the patch passed
_ Other Tests _
+1 💚 unit 9m 50s hbase-balancer in the patch passed.
28m 7s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 4a33ed1
Default Java AdoptOpenJDK-11.0.10+9
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/2/testReport/
Max. process+thread count 196 (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-4385/2/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@Apache-HBase
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 6m 8s Docker mode activated.
-0 ⚠️ yetus 0m 3s Unprocessed flag(s): --brief-report-file --spotbugs-strict-precheck --whitespace-eol-ignore-list --whitespace-tabs-ignore-list --quick-hadoopcheck
_ Prechecks _
_ master Compile Tests _
+1 💚 mvninstall 2m 27s master passed
+1 💚 compile 0m 14s master passed
+1 💚 shadedjars 3m 38s branch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 13s master passed
_ Patch Compile Tests _
+1 💚 mvninstall 2m 13s the patch passed
+1 💚 compile 0m 14s the patch passed
+1 💚 javac 0m 14s the patch passed
+1 💚 shadedjars 3m 38s patch has no errors when building our shaded downstream artifacts.
+1 💚 javadoc 0m 12s the patch passed
_ Other Tests _
+1 💚 unit 10m 10s hbase-balancer in the patch passed.
29m 48s
Subsystem Report/Notes
Docker ClientAPI=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 Tests javac javadoc unit shadedjars compile
uname Linux 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 tool maven
Personality dev-support/hbase-personality.sh
git revision master / 4a33ed1
Default Java AdoptOpenJDK-1.8.0_282-b08
Test Results https://ci-hbase.apache.org/job/HBase-PreCommit-GitHub-PR/job/PR-4385/2/testReport/
Max. process+thread count 161 (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-4385/2/console
versions git=2.17.1 maven=3.6.3
Powered by Apache Yetus 0.12.0 https://yetus.apache.org

This message was automatically generated.

@apurtell
Copy link
Contributor

apurtell commented May 2, 2022

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

@apurtell apurtell merged commit da55154 into apache:master May 2, 2022
asfgit pushed a commit that referenced this pull request May 2, 2022
…istency (#4385)

Signed-off-by: Andrew Purtell <[email protected]>
Reviewed by: Rushabh Shah <[email protected]>

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 <[email protected]>
Reviewed by: Rushabh Shah <[email protected]>

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 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.

4 participants