HBASE-2340 Add end-to-end test of sync/flush (forward-port from 0.20 branch of difference)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@944753 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
05980e26b8
commit
ef0421d856
|
@ -582,6 +582,9 @@ Release 0.21.0 - Unreleased
|
||||||
HBASE-2523 Add check for licenses before rolling an RC, add to
|
HBASE-2523 Add check for licenses before rolling an RC, add to
|
||||||
how-to-release doc. and check for inlining a tool that does
|
how-to-release doc. and check for inlining a tool that does
|
||||||
this for us
|
this for us
|
||||||
|
HBASE-2234 HBASE-2234 Roll Hlog if any datanode in the write pipeline dies
|
||||||
|
(Nicolas Spiegelberg via Stack)
|
||||||
|
HBASE-2340 Add end-to-end test of sync/flush (Forward-port from branch)
|
||||||
|
|
||||||
|
|
||||||
NEW FEATURES
|
NEW FEATURES
|
||||||
|
|
|
@ -39,15 +39,22 @@ public class TestFullLogReconstruction {
|
||||||
private final static byte[] TABLE_NAME = Bytes.toBytes("tabletest");
|
private final static byte[] TABLE_NAME = Bytes.toBytes("tabletest");
|
||||||
private final static byte[] FAMILY = Bytes.toBytes("family");
|
private final static byte[] FAMILY = Bytes.toBytes("family");
|
||||||
|
|
||||||
private Configuration conf;
|
/**
|
||||||
|
|
||||||
/**
|
|
||||||
* @throws java.lang.Exception
|
* @throws java.lang.Exception
|
||||||
*/
|
*/
|
||||||
@BeforeClass
|
@BeforeClass
|
||||||
public static void setUpBeforeClass() throws Exception {
|
public static void setUpBeforeClass() throws Exception {
|
||||||
TEST_UTIL.getConfiguration().
|
Configuration c = TEST_UTIL.getConfiguration();
|
||||||
setInt("hbase.regionserver.flushlogentries", 1);
|
c.setInt("hbase.regionserver.flushlogentries", 1);
|
||||||
|
c.setBoolean("dfs.support.append", true);
|
||||||
|
// quicker heartbeat interval for faster DN death notification
|
||||||
|
c.setInt("heartbeat.recheck.interval", 5000);
|
||||||
|
c.setInt("dfs.heartbeat.interval", 1);
|
||||||
|
c.setInt("dfs.socket.timeout", 5000);
|
||||||
|
// faster failover with cluster.shutdown();fs.close() idiom
|
||||||
|
c.setInt("ipc.client.connect.max.retries", 1);
|
||||||
|
c.setInt("dfs.client.block.recovery.retries", 1);
|
||||||
|
c.setInt("hbase.regionserver.flushlogentries", 1);
|
||||||
TEST_UTIL.startMiniCluster(2);
|
TEST_UTIL.startMiniCluster(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -64,8 +71,6 @@ public class TestFullLogReconstruction {
|
||||||
*/
|
*/
|
||||||
@Before
|
@Before
|
||||||
public void setUp() throws Exception {
|
public void setUp() throws Exception {
|
||||||
|
|
||||||
conf = TEST_UTIL.getConfiguration();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,24 +110,15 @@ public class TestFullLogReconstruction {
|
||||||
|
|
||||||
for(int i = 0; i < 4; i++) {
|
for(int i = 0; i < 4; i++) {
|
||||||
TEST_UTIL.loadTable(table, FAMILY);
|
TEST_UTIL.loadTable(table, FAMILY);
|
||||||
if(i == 2) {
|
|
||||||
TEST_UTIL.flush();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_UTIL.expireRegionServerSession(0);
|
TEST_UTIL.expireRegionServerSession(0);
|
||||||
|
|
||||||
scan = new Scan();
|
scan = new Scan();
|
||||||
|
|
||||||
results = table.getScanner(scan);
|
results = table.getScanner(scan);
|
||||||
|
|
||||||
int newCount = 0;
|
int newCount = 0;
|
||||||
for (Result res : results) {
|
for (Result res : results) {
|
||||||
newCount++;
|
newCount++;
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(count, newCount);
|
assertEquals(count, newCount);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue