-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
HBASE-28742 Fixes NPE for CompactionTool when mslab enabled #6097
Conversation
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
@Apache9 @bbeaudreault Please review |
So, if memstore lab is enabled, and we actually has a memstore, but there is no problem if we do not initialize the memstore chunk, but there will be an NPE while closing the memstore? Seems really strange... Do we really need memstore in CompactionTool? If not, I think we can just disable memstore lab to fix the problem for now? |
1020699
to
cf2b0cb
Compare
Yes, memstore lab can be disabled. Have pushed the fix. |
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
cf2b0cb
to
7b9c4f4
Compare
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Do we have a test for CompactionTool? I'm not very familiar with the code so I'm not sure whether it will use memstore, I guess it will not use, but better has a test to confirm this. Thanks. |
7b9c4f4
to
6deefef
Compare
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Added Test to validate the issue and fix |
* Test the issue of HBASE-28472 | ||
*/ | ||
@Category({ MediumTests.class, RegionServerTests.class }) | ||
public class TestCompactionToolNpeFix extends TestCompactionTool { |
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.
Do we really need to extends TestCompactionTool? Do we need to run the test in the parent class twice?
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.
Thanks @Apache9 for review.
In TestCompactionTool, when system is started with mslab enabled, then ChunkCreator is created and initialized. So when test case runs CompactionTool, it does not report NPE.
To reproduce the issue, setting mslab to disabled in derived class, and then base test fails with NPE as ChunkCreator is NULL.
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.
Then we can just change TestCompactionTool Parameterized? What is the purpose for the newly added test method?
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.
Other test case is added to test the CompactionTool MapReduce flow. Existing test case verifies the Non MapReduce flow.
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.
Then I think we should first change TestCompactionTool Parameterized, and then introduce a new tests? The current architecture seems really strange...
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.
Changed TestCompactionTool to Parameterized and added new cases in the same test file.
6deefef
to
d7b397e
Compare
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
d7b397e
to
9d623ee
Compare
🎊 +1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
Signed-off-by: Duo Zhang <zhangduo@apache.org> Signed-off-by: Pankaj Kumar <pankajkumar@apache.org> (cherry picked from commit 43b1d78)
Fixes NPE issue with initialization of ChunkCreator by disabling the mslab