HBASE-18362 hbck should not report split replica parent region from meta as errors (Huaxiang Sun)
Signed-off-by: Esteban Gutierrez <esteban@apache.org>
This commit is contained in:
parent
10573c6c99
commit
75789048c1
|
@ -2484,6 +2484,16 @@ public class HBaseFsck extends Configured implements Closeable {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For Replica region, we need to do a similar check. If replica is not split successfully,
|
||||||
|
// error is going to be reported against primary daughter region.
|
||||||
|
if (hbi.getReplicaId() != HRegionInfo.DEFAULT_REPLICA_ID) {
|
||||||
|
LOG.info("Region " + descriptiveName + " is a split parent in META, in HDFS, "
|
||||||
|
+ "and not deployed on any region server. This may be transient.");
|
||||||
|
hbi.setSkipChecks(true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
errors.reportError(ERROR_CODE.LINGERING_SPLIT_PARENT, "Region "
|
errors.reportError(ERROR_CODE.LINGERING_SPLIT_PARENT, "Region "
|
||||||
+ descriptiveName + " is a split parent in META, in HDFS, "
|
+ descriptiveName + " is a split parent in META, in HDFS, "
|
||||||
+ "and not deployed on any region server. This could be transient, "
|
+ "and not deployed on any region server. This could be transient, "
|
||||||
|
|
|
@ -110,6 +110,31 @@ public class TestHBaseFsckReplicas extends BaseTestHBaseFsck {
|
||||||
EnvironmentEdgeManager.reset();
|
EnvironmentEdgeManager.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This creates a table with region_replica > 1, do a split, check
|
||||||
|
* that hbck will not report split replica parent as lingering split parent
|
||||||
|
*/
|
||||||
|
@Test public void testHbckReportReplicaLingeringSplitParent() throws Exception {
|
||||||
|
TableName table = TableName.valueOf("testHbckReportReplicaLingeringSplitParent");
|
||||||
|
|
||||||
|
try {
|
||||||
|
setupTableWithRegionReplica(table, 2);
|
||||||
|
admin.flush(table);
|
||||||
|
|
||||||
|
// disable catalog janitor
|
||||||
|
admin.enableCatalogJanitor(false);
|
||||||
|
admin.split(table, Bytes.toBytes("A1"));
|
||||||
|
|
||||||
|
Thread.sleep(1000);
|
||||||
|
// run hbck again to make sure we don't see any errors
|
||||||
|
assertNoErrors(doFsck(conf, false));
|
||||||
|
} finally {
|
||||||
|
cleanupTable(table);
|
||||||
|
// enable catalog janitor
|
||||||
|
admin.enableCatalogJanitor(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This creates a table with region_replica > 1 and verifies hbck runs
|
* This creates a table with region_replica > 1 and verifies hbck runs
|
||||||
* successfully
|
* successfully
|
||||||
|
|
Loading…
Reference in New Issue