浏览代码

HDFS-4826. TestNestedSnapshots times out due to repeated slow edit log flushes when running on virtualized disk. Contributed by Chris Nauroth

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1483150 13f79535-47bb-0310-9956-ffa450edef68
Tsz-wo Sze 12 年之前
父节点
当前提交
da05873e0e

+ 3 - 0
hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt

@@ -144,6 +144,9 @@ Trunk (Unreleased)
     HDFS-347. DFS read performance suboptimal when client co-located on nodes
     with data. (Colin Patrick McCabe via todd and atm)
 
+    HDFS-4826. TestNestedSnapshots times out due to repeated slow edit log
+    flushes when running on virtualized disk.  (Chris Nauroth via szetszwo)
+
   OPTIMIZATIONS
 
   BUG FIXES

+ 7 - 0
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/snapshot/TestNestedSnapshots.java

@@ -36,6 +36,7 @@ import org.apache.hadoop.hdfs.DistributedFileSystem;
 import org.apache.hadoop.hdfs.MiniDFSCluster;
 import org.apache.hadoop.hdfs.protocol.HdfsConstants;
 import org.apache.hadoop.hdfs.protocol.NSQuotaExceededException;
+import org.apache.hadoop.hdfs.server.namenode.EditLogFileOutputStream;
 import org.apache.hadoop.hdfs.server.namenode.FSDirectory;
 import org.apache.hadoop.hdfs.server.namenode.INode;
 import org.apache.hadoop.hdfs.server.namenode.INodeDirectory;
@@ -48,6 +49,12 @@ import org.junit.Test;
 
 /** Testing nested snapshots. */
 public class TestNestedSnapshots {
+  static {
+    // These tests generate a large number of edits, and repeated edit log
+    // flushes can be a bottleneck.
+    EditLogFileOutputStream.setShouldSkipFsyncForTesting(true);
+  }
+
   {
     SnapshotTestHelper.disableLogs();
   }