-
Notifications
You must be signed in to change notification settings - Fork 3.4k
HBASE-30169 Split completed parent region added to RIT list on host RS and master crash #8264
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
Open
Umeshkumar9414
wants to merge
3
commits into
apache:master
Choose a base branch
from
Umeshkumar9414:HBASE-30169
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,8 @@ | |
|
|
||
| import static org.apache.hadoop.hbase.master.assignment.AssignmentTestingUtil.insertData; | ||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
| import static org.junit.jupiter.api.Assertions.assertFalse; | ||
| import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
| import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
|
||
| import java.util.List; | ||
| import java.util.Map; | ||
|
|
@@ -117,8 +117,8 @@ public void testSplitTableRegion() throws Exception { | |
| int splitRowNum = startRowNum + rowCount / 2; | ||
| byte[] splitKey = Bytes.toBytes("" + splitRowNum); | ||
|
|
||
| assertTrue(regions != null, "not able to find a splittable region"); | ||
| assertTrue(regions.length == 1, "not able to find a splittable region"); | ||
| assertNotNull(regions, "not able to find a splittable region"); | ||
| assertEquals(1, regions.length, "not able to find a splittable region"); | ||
|
|
||
| // Split region of the table | ||
| long procId = procExec.submitProcedure( | ||
|
|
@@ -127,7 +127,7 @@ public void testSplitTableRegion() throws Exception { | |
| ProcedureTestingUtility.waitProcedure(procExec, procId); | ||
| ProcedureTestingUtility.assertProcNotFailed(procExec, procId); | ||
|
|
||
| assertTrue(UTIL.getHBaseCluster().getRegions(tableName).size() == 2, "not able to split table"); | ||
| assertEquals(2, UTIL.getHBaseCluster().getRegions(tableName).size(), "not able to split table"); | ||
|
|
||
| // disable table | ||
| UTIL.getAdmin().disableTable(tableName); | ||
|
|
@@ -155,6 +155,54 @@ public void testSplitTableRegion() throws Exception { | |
| regionInfoMap.get(tableRegions.get(1).getRegionInfo())); | ||
| } | ||
|
|
||
| @Test | ||
| public void testRITWithSplitTableRegion() throws Exception { | ||
| final TableName tableName = TableName.valueOf(testMethodName); | ||
| final ProcedureExecutor<MasterProcedureEnv> procExec = getMasterProcedureExecutor(); | ||
|
|
||
| RegionInfo[] regions = | ||
| MasterProcedureTestingUtility.createTable(procExec, tableName, null, columnFamilyName); | ||
| insertData(UTIL, tableName, rowCount, startRowNum, columnFamilyName); | ||
| int splitRowNum = startRowNum + rowCount / 2; | ||
| byte[] splitKey = Bytes.toBytes("" + splitRowNum); | ||
|
|
||
| assertNotNull(regions, "not able to find a splittable region"); | ||
| assertEquals(1, regions.length, "not able to find a splittable region"); | ||
| assertEquals(0, | ||
| UTIL.getHBaseCluster().getMaster().getAssignmentManager().getRegionsInTransitionCount()); | ||
|
|
||
| ServerName targetRS = UTIL.getHBaseCluster().getMaster().getAssignmentManager() | ||
| .getRegionStates().getRegionServerOfRegion(regions[0]); | ||
| // Split region of the table | ||
| long procId = procExec.submitProcedure( | ||
| new SplitTableRegionProcedure(procExec.getEnvironment(), regions[0], splitKey)); | ||
| // Wait the completion | ||
| ProcedureTestingUtility.waitProcedure(procExec, procId); | ||
| ProcedureTestingUtility.assertProcNotFailed(procExec, procId); | ||
|
|
||
| assertEquals(2, UTIL.getHBaseCluster().getRegions(tableName).size(), "not able to split table"); | ||
| assertEquals(0, | ||
| UTIL.getHBaseCluster().getMaster().getAssignmentManager().getRegionsInTransitionCount()); | ||
| // As there are only 3 RS, start one more RS before expiring one | ||
| UTIL.getHBaseCluster().startRegionServer(); | ||
|
|
||
| // stop RS holding split parent | ||
| UTIL.getHBaseCluster().getMaster().getServerManager().expireServer(targetRS); | ||
|
|
||
| // stop master | ||
| UTIL.getHBaseCluster().stopMaster(0); | ||
| UTIL.getHBaseCluster().waitOnMaster(0); | ||
| Thread.sleep(500); | ||
|
Comment on lines
+186
to
+195
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also one to look at. |
||
|
|
||
| // restart master | ||
| JVMClusterUtil.MasterThread t = UTIL.getHBaseCluster().startMaster(); | ||
| UTIL.getHBaseCluster().waitForActiveAndReadyMaster(10000); | ||
| UTIL.invalidateConnection(); | ||
|
|
||
| assertFalse(AssignmentTestingUtil.isRegionInTransition(regions[0], | ||
| UTIL.getHBaseCluster().getMaster().getAssignmentManager())); | ||
| } | ||
|
|
||
| @Test | ||
| public void testSplitStoreFiles() throws Exception { | ||
| final TableName tableName = TableName.valueOf(testMethodName); | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Let's do this one.