Package org.apache.hadoop.hbase.master
Class TestRecoverUnknownWithNullRegionLocation
java.lang.Object
org.apache.hadoop.hbase.master.TestRecoverUnknownWithNullRegionLocation
@Tag("org.apache.hadoop.hbase.testclassification.MasterTests") @Tag("org.apache.hadoop.hbase.testclassification.MediumTests")
public class TestRecoverUnknownWithNullRegionLocation
extends Object
Test for HBASE-30142. Verifies that
scheduleSCPsForUnknownServers (i.e. the
recoverUnknown HBCK command) does not throw a NullPointerException when a region's
regionLocation is null while its state is something other than OFFLINE.
Before HBASE-30142, ServerManager.isServerUnknown(org.apache.hadoop.hbase.ServerName)
returned true for a null server name, so a region whose location had been
temporarily nulled (e.g. between region transitions or while marking it FAILED_OPEN /
ABNORMALLY_CLOSED) was treated as living on an "unknown" server. The downstream call to
shouldSubmitSCP(null) then dereferenced the null and crashed.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final byte[]private static final org.apache.hadoop.hbase.TableNameprivate static HBaseTestingUtil -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidstatic voidvoidDrive the region into ABNORMALLY_CLOSED through theAssignmentManager.regionClosedAbnormally(RegionStateNode)path (the same path SCP uses).
-
Field Details
-
UTIL
-
TABLE_NAME
-
FAMILY
-
-
Constructor Details
-
TestRecoverUnknownWithNullRegionLocation
-
-
Method Details
-
setUpBeforeClass
- Throws:
Exception
-
tearDownAfterClass
- Throws:
Exception
-
testRecoverUnknownWithAbnormallyClosedRegion
Drive the region into ABNORMALLY_CLOSED through theAssignmentManager.regionClosedAbnormally(RegionStateNode)path (the same path SCP uses). That method also nullsregionLocationwhile leaving state non-OFFLINE. Then callscheduleSCPsForUnknownServersand assert no NPE.- Throws:
Exception
-