HBASE-14608 testWalRollOnLowReplication has some risk to assert failed after HBASE-14600 (Heng Chen)
This commit is contained in:
parent
bd78320caa
commit
a3f588b26f
|
@ -71,6 +71,17 @@ public class TestWALProcedureStoreOnHDFS {
|
||||||
|
|
||||||
private WALProcedureStore store;
|
private WALProcedureStore store;
|
||||||
|
|
||||||
|
private ProcedureStore.ProcedureStoreListener stopProcedureListener = new ProcedureStore.ProcedureStoreListener() {
|
||||||
|
@Override
|
||||||
|
public void postSync() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void abortProcess() {
|
||||||
|
LOG.fatal("Abort the Procedure Store");
|
||||||
|
store.stop(true);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private static void setupConf(Configuration conf) {
|
private static void setupConf(Configuration conf) {
|
||||||
conf.setInt("dfs.replication", 3);
|
conf.setInt("dfs.replication", 3);
|
||||||
conf.setInt("dfs.namenode.replication.min", 3);
|
conf.setInt("dfs.namenode.replication.min", 3);
|
||||||
|
@ -89,16 +100,7 @@ public class TestWALProcedureStoreOnHDFS {
|
||||||
Path logDir = new Path(new Path(dfs.getFileSystem().getUri()), "/test-logs");
|
Path logDir = new Path(new Path(dfs.getFileSystem().getUri()), "/test-logs");
|
||||||
store = ProcedureTestingUtility.createWalStore(
|
store = ProcedureTestingUtility.createWalStore(
|
||||||
UTIL.getConfiguration(), dfs.getFileSystem(), logDir);
|
UTIL.getConfiguration(), dfs.getFileSystem(), logDir);
|
||||||
store.registerListener(new ProcedureStore.ProcedureStoreListener() {
|
store.registerListener(stopProcedureListener);
|
||||||
@Override
|
|
||||||
public void postSync() {}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void abortProcess() {
|
|
||||||
LOG.fatal("Abort the Procedure Store");
|
|
||||||
store.stop(true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
store.start(8);
|
store.start(8);
|
||||||
store.recoverLease();
|
store.recoverLease();
|
||||||
}
|
}
|
||||||
|
@ -136,7 +138,6 @@ public class TestWALProcedureStoreOnHDFS {
|
||||||
@Test(timeout=60000)
|
@Test(timeout=60000)
|
||||||
public void testWalAbortOnLowReplicationWithQueuedWriters() throws Exception {
|
public void testWalAbortOnLowReplicationWithQueuedWriters() throws Exception {
|
||||||
assertEquals(3, UTIL.getDFSCluster().getDataNodes().size());
|
assertEquals(3, UTIL.getDFSCluster().getDataNodes().size());
|
||||||
|
|
||||||
store.registerListener(new ProcedureStore.ProcedureStoreListener() {
|
store.registerListener(new ProcedureStore.ProcedureStoreListener() {
|
||||||
@Override
|
@Override
|
||||||
public void postSync() {
|
public void postSync() {
|
||||||
|
@ -182,6 +183,15 @@ public class TestWALProcedureStoreOnHDFS {
|
||||||
|
|
||||||
@Test(timeout=60000)
|
@Test(timeout=60000)
|
||||||
public void testWalRollOnLowReplication() throws Exception {
|
public void testWalRollOnLowReplication() throws Exception {
|
||||||
|
store.unregisterListener(stopProcedureListener);
|
||||||
|
store.registerListener(new ProcedureStore.ProcedureStoreListener() {
|
||||||
|
@Override
|
||||||
|
public void postSync() {}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void abortProcess() {
|
||||||
|
}
|
||||||
|
});
|
||||||
int dnCount = 0;
|
int dnCount = 0;
|
||||||
store.insert(new TestProcedure(1, -1), null);
|
store.insert(new TestProcedure(1, -1), null);
|
||||||
UTIL.getDFSCluster().restartDataNode(dnCount);
|
UTIL.getDFSCluster().restartDataNode(dnCount);
|
||||||
|
|
Loading…
Reference in New Issue