You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hbase.apache.org by nd...@apache.org on 2015/06/16 02:41:33 UTC

hbase git commit: HBASE-13905 TestRecoveredEdits.testReplayWorksThoughLotsOfFlushing failing consistently on branch-1.1

Repository: hbase
Updated Branches:
  refs/heads/master 461f5307b -> 35a9c509f


HBASE-13905 TestRecoveredEdits.testReplayWorksThoughLotsOfFlushing failing consistently on branch-1.1


Project: http://git-wip-us.apache.org/repos/asf/hbase/repo
Commit: http://git-wip-us.apache.org/repos/asf/hbase/commit/35a9c509
Tree: http://git-wip-us.apache.org/repos/asf/hbase/tree/35a9c509
Diff: http://git-wip-us.apache.org/repos/asf/hbase/diff/35a9c509

Branch: refs/heads/master
Commit: 35a9c509fb517ca846e2a376d7e7bdf30344d20f
Parents: 461f530
Author: Nick Dimiduk <nd...@apache.org>
Authored: Mon Jun 15 17:15:22 2015 -0700
Committer: Nick Dimiduk <nd...@apache.org>
Committed: Mon Jun 15 17:15:47 2015 -0700

----------------------------------------------------------------------
 .../hbase/regionserver/TestRecoveredEdits.java  | 20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hbase/blob/35a9c509/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java
----------------------------------------------------------------------
diff --git a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java
index be7f4a2..c339bb1 100644
--- a/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java
+++ b/hbase-server/src/test/java/org/apache/hadoop/hbase/regionserver/TestRecoveredEdits.java
@@ -23,6 +23,8 @@ import static org.junit.Assert.assertTrue;
 import java.io.IOException;
 import java.util.List;
 
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.fs.FileSystem;
 import org.apache.hadoop.fs.Path;
@@ -42,6 +44,7 @@ import org.apache.hadoop.hbase.client.Result;
 import org.apache.hadoop.hbase.regionserver.wal.WALEdit;
 import org.apache.hadoop.hbase.testclassification.MediumTests;
 import org.apache.hadoop.hbase.util.Bytes;
+import org.apache.hadoop.hbase.util.FSUtils;
 import org.apache.hadoop.hbase.wal.WAL;
 import org.apache.hadoop.hbase.wal.WALFactory;
 import org.apache.hadoop.hbase.wal.WALKey;
@@ -50,7 +53,6 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.experimental.categories.Category;
 import org.junit.rules.TestName;
-import org.mortbay.log.Log;
 
 /**
  * Tests around replay of recovered.edits content.
@@ -58,6 +60,7 @@ import org.mortbay.log.Log;
 @Category({MediumTests.class})
 public class TestRecoveredEdits {
   private static final HBaseTestingUtility TEST_UTIL = new HBaseTestingUtility();
+  private static final Log LOG = LogFactory.getLog(TestRecoveredEdits.class);
   @Rule public TestName testName = new TestName();
 
   /**
@@ -67,7 +70,7 @@ public class TestRecoveredEdits {
    * made it in.
    * @throws IOException
    */
-  @Test (timeout=30000)
+  @Test (timeout=60000)
   public void testReplayWorksThoughLotsOfFlushing() throws IOException {
     Configuration conf = new Configuration(TEST_UTIL.getConfiguration());
     // Set it so we flush every 1M or so.  Thats a lot.
@@ -96,6 +99,14 @@ public class TestRecoveredEdits {
       }
     };
     Path hbaseRootDir = TEST_UTIL.getDataTestDir();
+    FileSystem fs = FileSystem.get(TEST_UTIL.getConfiguration());
+    Path tableDir = FSUtils.getTableDir(hbaseRootDir, htd.getTableName());
+    HRegionFileSystem hrfs =
+        new HRegionFileSystem(TEST_UTIL.getConfiguration(), fs, tableDir, hri);
+    if (fs.exists(hrfs.getRegionDir())) {
+      LOG.info("Region directory already exists. Deleting.");
+      fs.delete(hrfs.getRegionDir(), true);
+    }
     HRegion region = HRegion.createHRegion(hri, hbaseRootDir, conf, htd, null);
     assertEquals(encodedRegionName, region.getRegionInfo().getEncodedName());
     List<String> storeFiles = region.getStoreFileList(columnFamilyAsByteArray);
@@ -109,7 +120,6 @@ public class TestRecoveredEdits {
       System.getProperty("project.build.testSourceDirectory", "src" + Path.SEPARATOR + "test"),
       "data"), "0000000000000016310");
     // Copy this file under the region's recovered.edits dir so it is replayed on reopen.
-    FileSystem fs = FileSystem.get(conf);
     Path destination = new Path(recoveredEditsDir, recoveredEditsFile.getName());
     fs.copyToLocalFile(recoveredEditsFile, destination);
     assertTrue(fs.exists(destination));
@@ -123,7 +133,7 @@ public class TestRecoveredEdits {
     assertTrue("Files count=" + storeFiles.size(), storeFiles.size() > 10);
     // Now verify all edits made it into the region.
     int count = verifyAllEditsMadeItIn(fs, conf, recoveredEditsFile, region);
-    Log.info("Checked " + count + " edits made it in");
+    LOG.info("Checked " + count + " edits made it in");
   }
 
   /**
@@ -176,4 +186,4 @@ public class TestRecoveredEdits {
     }
     return count;
   }
-}
\ No newline at end of file
+}