Class TestSplitParentAssignment
java.lang.Object
org.apache.hadoop.hbase.master.assignment.TestSplitParentAssignment
@Tag("org.apache.hadoop.hbase.testclassification.MasterTests") @Tag("org.apache.hadoop.hbase.testclassification.MediumTests")
public class TestSplitParentAssignment
extends Object
Regression test for HBASE-30353: a split parent region must never be re-opened after master
failover.
The fix has two parts. RegionStateStore.splitRegion now writes SPLIT into
info:state for the parent; that is covered by TestRegionStateStore. This class
covers the second part, the isSplit() check in
AssignmentManager.createAssignProcedure. It matters for parents loaded from meta rows
written before the fix (state CLOSED with regionInfo.isSplit()=true), which pass
the expected-state check, and for forced assigns, which skip it. The tests go through the client
entry points, Admin.assign and Hbck.assigns.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final org.slf4j.Loggerprivate static final intprivate static final intprivate Stringprivate static final HBaseTestingUtil -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv>voidsetup(org.junit.jupiter.api.TestInfo testInfo) static voidprivate org.apache.hadoop.hbase.master.assignment.RegionStateNodesimulatePostFailover(org.apache.hadoop.hbase.master.assignment.AssignmentManager am, org.apache.hadoop.hbase.client.RegionInfo parentInfo, org.apache.hadoop.hbase.master.RegionState.State state) Replaces the parent'sRegionStateNodewith one shaped likeloadMetawould rebuild it after a master failover:regionInfo.isSplit()=trueand the given state.private org.apache.hadoop.hbase.client.RegionInfosplitTableAndGetParent(org.apache.hadoop.hbase.TableName tableName) voidtearDown()static voidvoidvoid
-
Field Details
-
LOG
-
UTIL
-
CF
- See Also:
-
ROW_COUNT
- See Also:
-
START_ROW
- See Also:
-
testMethodName
-
-
Constructor Details
-
TestSplitParentAssignment
public TestSplitParentAssignment()
-
-
Method Details
-
setupCluster
- Throws:
Exception
-
tearDownCluster
- Throws:
IOException
-
setup
- Throws:
Exception
-
tearDown
- Throws:
Exception
-
testAdminAssignRejectsSplitParentLoadedAsClosed
- Throws:
Exception
-
testHbckForceAssignRejectsSplitParentLoadedAsClosed
- Throws:
Exception
-
splitTableAndGetParent
private org.apache.hadoop.hbase.client.RegionInfo splitTableAndGetParent(org.apache.hadoop.hbase.TableName tableName) throws Exception - Throws:
Exception
-
simulatePostFailover
private org.apache.hadoop.hbase.master.assignment.RegionStateNode simulatePostFailover(org.apache.hadoop.hbase.master.assignment.AssignmentManager am, org.apache.hadoop.hbase.client.RegionInfo parentInfo, org.apache.hadoop.hbase.master.RegionState.State state) Replaces the parent'sRegionStateNodewith one shaped likeloadMetawould rebuild it after a master failover:regionInfo.isSplit()=trueand the given state. PassCLOSEDto reproduce a meta row written before HBASE-30353, where the parent'sinfo:statewas notSPLIT. -
getMasterProcedureExecutor
private org.apache.hadoop.hbase.procedure2.ProcedureExecutor<org.apache.hadoop.hbase.master.procedure.MasterProcedureEnv> getMasterProcedureExecutor()
-