hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aengin...@apache.org
Subject [10/50] [abbrv] hadoop git commit: HDFS-8908. TestAppendSnapshotTruncate may fail with IOException: Failed to replace a bad datanode. (Tsz Wo Nicholas Sze via yliu)
Date Tue, 25 Aug 2015 22:22:04 GMT
HDFS-8908. TestAppendSnapshotTruncate may fail with IOException: Failed to replace a bad datanode.
(Tsz Wo Nicholas Sze via yliu)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/2da5aaab
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/2da5aaab
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/2da5aaab

Branch: refs/heads/HDFS-7240
Commit: 2da5aaab334d0d6a7dee244cac603aa35c9b0134
Parents: 22dc5fc
Author: yliu <yliu@apache.org>
Authored: Wed Aug 19 21:55:43 2015 +0800
Committer: yliu <yliu@apache.org>
Committed: Wed Aug 19 21:55:43 2015 +0800

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt            |  3 +++
 .../apache/hadoop/hdfs/TestAppendSnapshotTruncate.java | 13 ++++++++-----
 2 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/2da5aaab/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index 038a646..f43f795 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -1174,6 +1174,9 @@ Release 2.8.0 - UNRELEASED
 
     HDFS-8891. HDFS concat should keep srcs order. (Yong Zhang via jing9)
 
+    HDFS-8908. TestAppendSnapshotTruncate may fail with IOException: Failed to
+    replace a bad datanode. (Tsz Wo Nicholas Sze via yliu)
+
 Release 2.7.2 - UNRELEASED
 
   INCOMPATIBLE CHANGES

http://git-wip-us.apache.org/repos/asf/hadoop/blob/2da5aaab/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestAppendSnapshotTruncate.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestAppendSnapshotTruncate.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestAppendSnapshotTruncate.java
index d67ceb0..9a09987 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestAppendSnapshotTruncate.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestAppendSnapshotTruncate.java
@@ -27,7 +27,6 @@ import java.io.RandomAccessFile;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.Map;
-import java.util.Random;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ThreadLocalRandom;
 import java.util.concurrent.atomic.AtomicBoolean;
@@ -42,6 +41,7 @@ import org.apache.hadoop.fs.FSDataOutputStream;
 import org.apache.hadoop.fs.FileStatus;
 import org.apache.hadoop.fs.FileUtil;
 import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.hdfs.client.HdfsClientConfigKeys.BlockWrite.ReplaceDatanodeOnFailure;
 import org.apache.hadoop.hdfs.server.namenode.NameNode;
 import org.apache.hadoop.hdfs.server.namenode.TestFileTruncate;
 import org.apache.hadoop.test.GenericTestUtils;
@@ -64,10 +64,10 @@ public class TestAppendSnapshotTruncate {
   }
   private static final Log LOG = LogFactory.getLog(TestAppendSnapshotTruncate.class);
   private static final int BLOCK_SIZE = 1024;
-  private static final int DATANODE_NUM = 3;
+  private static final int DATANODE_NUM = 4;
   private static final short REPLICATION = 3;
-  private static final int FILE_WORKER_NUM = 3;
-  private static final long TEST_TIME_SECOND = 10;
+  private static final int FILE_WORKER_NUM = 10;
+  private static final long TEST_TIME_SECOND = 20;
   private static final long TEST_TIMEOUT_SECOND = TEST_TIME_SECOND + 60;
 
   static final int SHORT_HEARTBEAT = 1;
@@ -85,6 +85,7 @@ public class TestAppendSnapshotTruncate {
     conf.setInt(DFSConfigKeys.DFS_HEARTBEAT_INTERVAL_KEY, SHORT_HEARTBEAT);
     conf.setLong(
         DFSConfigKeys.DFS_NAMENODE_REPLICATION_PENDING_TIMEOUT_SEC_KEY, 1);
+    conf.setBoolean(ReplaceDatanodeOnFailure.BEST_EFFORT_KEY, true);
     cluster = new MiniDFSCluster.Builder(conf)
         .format(true)
         .numDataNodes(DATANODE_NUM)
@@ -476,7 +477,9 @@ public class TestAppendSnapshotTruncate {
     }
 
     void pause() {
-      Preconditions.checkState(state.compareAndSet(State.RUNNING, State.IDLE));
+      checkErrorState();
+      Preconditions.checkState(state.compareAndSet(State.RUNNING, State.IDLE),
+          "%s: state=%s != %s", name, state.get(), State.RUNNING);
     }
 
     void stop() throws InterruptedException {


Mime
View raw message