Repository: hbase Updated Branches: refs/heads/master ea0731d60 -> 9dcebc396
HBASE-11217 Race between SplitLogManager task creation + TimeoutMonitor - ADDENDUM to fix unit test Project: http://git-wip-us.apache.org/repos/asf/hbase/repo Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/9dcebc39 Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/9dcebc39 Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/9dcebc39 Branch: refs/heads/master Commit: 9dcebc396bf7dc697fba990c6ee35bc5009a7dc9 Parents: ea0731d Author: Enis Soztutar <[email protected]> Authored: Thu May 22 18:27:30 2014 -0700 Committer: Enis Soztutar <[email protected]> Committed: Thu May 22 18:27:42 2014 -0700 ---------------------------------------------------------------------- .../hbase/master/TestSplitLogManager.java | 45 -------------------- 1 file changed, 45 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/hbase/blob/9dcebc39/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java ---------------------------------------------------------------------- diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java index 82b8673..ed51484 100644 --- a/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java +++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestSplitLogManager.java @@ -491,51 +491,6 @@ public class TestSplitLogManager { assertFalse(fs.exists(emptyLogDirPath)); } - @Test(timeout=45000) - public void testVanishingTaskZNode() throws Exception { - LOG.info("testVanishingTaskZNode"); - - conf.setInt("hbase.splitlog.manager.unassigned.timeout", 0); - conf.setInt("hbase.splitlog.manager.timeoutmonitor.period", 1000); - slm = new SplitLogManager(zkw, conf, stopper, master, DUMMY_MASTER); - FileSystem fs = TEST_UTIL.getTestFileSystem(); - final Path logDir = new Path(fs.getWorkingDirectory(), - UUID.randomUUID().toString()); - fs.mkdirs(logDir); - Thread thread = null; - try { - Path logFile = new Path(logDir, UUID.randomUUID().toString()); - fs.createNewFile(logFile); - thread = new Thread() { - public void run() { - try { - // this call will block because there are no SplitLogWorkers, - // until the task znode is deleted below. Then the call will - // complete successfully, assuming the log is split. - slm.splitLogDistributed(logDir); - } catch (Exception e) { - LOG.warn("splitLogDistributed failed", e); - } - } - }; - thread.start(); - waitForCounter(tot_mgr_node_create_result, 0, 1, 10000); - String znode = ZKSplitLog.getEncodedNodeName(zkw, logFile.toString()); - // remove the task znode, to finish the distributed log splitting - ZKUtil.deleteNode(zkw, znode); - waitForCounter(tot_mgr_get_data_nonode, 0, 1, 30000); - waitForCounter(tot_mgr_log_split_batch_success, 0, 1, to/2); - assertTrue(fs.exists(logFile)); - } finally { - if (thread != null) { - // interrupt the thread in case the test fails in the middle. - // it has no effect if the thread is already terminated. - thread.interrupt(); - } - fs.delete(logDir, true); - } - } - /** * The following test case is aiming to test the situation when distributedLogReplay is turned off * and restart a cluster there should no recovery regions in ZK left.
