-
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-22774 [WAL] RegionGroupingStrategy loses its function after split #460
Conversation
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
@@ -7177,8 +7177,8 @@ HRegion createDaughterRegionFromSplits(final HRegionInfo hri) throws IOException | |||
fs.commitDaughterRegion(hri); | |||
|
|||
// Create the daughter HRegion instance | |||
HRegion r = HRegion.newHRegion(this.fs.getTableDir(), this.getWAL(), fs.getFileSystem(), | |||
this.getBaseConf(), hri, this.getTableDesc(), rsServices); | |||
HRegion r = HRegion.newHRegion(this.fs.getTableDir(), rsServices.getWAL(hri), |
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.
rsServices.getWAL(hri)
Based on WALProvider impl, it will create a new wal according to strategy or inherit parent's wal by default mode.
2nd commit, improve some naming readability. |
💔 -1 overall
This message was automatically generated. |
Related failure, working.. |
3rd commit should fix the UT failure. |
@@ -277,7 +323,7 @@ public void testWholesomeSplit() throws IOException { | |||
assertTrue(count > 0 && count != rowcount); | |||
daughtersRowCount += count; | |||
} finally { | |||
HRegion.closeHRegion((HRegion)openRegion); |
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.
HRegion.closeHRegion
method will close WAL, then second daughter region will get exception. That's why i replace it with ((HRegion) openRegion).close()
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.
Makes sense! 👍
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
Unrelated failure. |
🎊 +1 overall
This message was automatically generated. |
HRegion r = HRegion.newHRegion(this.fs.getTableDir(), this.getWAL(), fs.getFileSystem(), | ||
this.getBaseConf(), hri, this.getTableDesc(), rsServices); | ||
HRegion r = HRegion.newHRegion(this.fs.getTableDir(), | ||
rsServices == null ? getWAL() :rsServices.getWAL(hri), // rsServices can be null in UT |
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.
Please extract this expression to a variable.
@@ -72,7 +72,7 @@ public void init(Configuration config, String providerId) { | |||
int regionGroupNumber = config.getInt(NUM_REGION_GROUPS, DEFAULT_NUM_REGION_GROUPS); | |||
groupNames = new String[regionGroupNumber]; | |||
for (int i = 0; i < regionGroupNumber; i++) { | |||
groupNames[i] = providerId + GROUP_NAME_DELIMITER + "regiongroup-" + i; |
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.
GROUP_NAME_DELIMITER is unused from now on. Can it be removed? It is in IA.Private class.
@@ -277,7 +323,7 @@ public void testWholesomeSplit() throws IOException { | |||
assertTrue(count > 0 && count != rowcount); | |||
daughtersRowCount += count; | |||
} finally { | |||
HRegion.closeHRegion((HRegion)openRegion); |
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.
Makes sense! 👍
💔 -1 overall
This message was automatically generated. |
2nd commit addressed comments only, failed tests are not related. |
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.
Looks good!
Thanks Peter for the review! @petersomogyi |
💔 -1 overall
This message was automatically generated. |
💔 -1 overall
This message was automatically generated. |
🎊 +1 overall
This message was automatically generated. |
JIRA link