-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-26989 TestStochasticLoadBalancer fixes for performance and consistency #4385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
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); |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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!
b81eb8b to
73df9fe
Compare
There was a problem hiding this 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
|
🎊 +1 overall
This message was automatically generated. |
|
🎊 +1 overall
This message was automatically generated. |
|
@d-c-manning Please resolve conflicts and I will merge it. |
…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
…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
HBASE-26989
When running the tests locally, I see these runtime improvements:
testNeedBalance: from 120 seconds to 11 secondstestSloppyTablesLoadBalanceByTable27 seconds to <1 secondtestBalanceOfSloppyServers67 seconds to <1 secondI ran
testNeedBalance100 times locally, and the other two tests I ran 1000 times locally.So total class
TestStochasticLoadBalancerruntime 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.