hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [10/34] hadoop git commit: HDFS-9865. TestBlockReplacement fails intermittently in trunk (Lin Yiqun via iwasakims)
Date Wed, 09 Mar 2016 17:45:10 GMT
HDFS-9865. TestBlockReplacement fails intermittently in trunk (Lin Yiqun via iwasakims)


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

Branch: refs/heads/HDFS-1312
Commit: d718fc1ee5aee3628e105339ee3ea183b6242409
Parents: 4163e36
Author: Masatake Iwasaki <iwasakims@apache.org>
Authored: Tue Mar 8 02:07:18 2016 +0900
Committer: Masatake Iwasaki <iwasakims@apache.org>
Committed: Tue Mar 8 02:07:18 2016 +0900

----------------------------------------------------------------------
 .../server/datanode/TestBlockReplacement.java     | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/d718fc1e/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockReplacement.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockReplacement.java
b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockReplacement.java
index bfd02e2..286a180 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockReplacement.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestBlockReplacement.java
@@ -412,11 +412,19 @@ public class TestBlockReplacement {
           (DatanodeInfo)sourceDnDesc, (DatanodeInfo)sourceDnDesc,
           (DatanodeInfo)destDnDesc));
       // Waiting for the FsDatasetAsyncDsikService to delete the block
-      Thread.sleep(3000);
-      // Triggering the incremental block report to report the deleted block to
-      // namnemode
-      cluster.getDataNodes().get(0).triggerBlockReport(
-         new BlockReportOptions.Factory().setIncremental(true).build());
+      for (int tries = 0; tries < 20; tries++) {
+        Thread.sleep(1000);
+        // Triggering the deletion block report to report the deleted block
+        // to namnemode
+        DataNodeTestUtils.triggerDeletionReport(cluster.getDataNodes().get(0));
+        locatedBlocks =
+            client.getNamenode().getBlockLocations("/tmp.txt", 0, 10L)
+                .getLocatedBlocks();
+        // If block was deleted and only on 1 datanode then break out
+        if (locatedBlocks.get(0).getLocations().length == 1) {
+          break;
+        }
+      }
 
       cluster.transitionToStandby(0);
       cluster.transitionToActive(1);


Mime
View raw message