You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-commits@hadoop.apache.org by aa...@apache.org on 2020/10/27 08:09:20 UTC

[hadoop] branch branch-3.3 updated: HDFS-15461. TestDFSClientRetries testGetFileChecksum fails (#2404)

This is an automated email from the ASF dual-hosted git repository.

aajisaka pushed a commit to branch branch-3.3
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.3 by this push:
     new 1429c65  HDFS-15461. TestDFSClientRetries testGetFileChecksum fails (#2404)
1429c65 is described below

commit 1429c65533273e525990781d1eb3e08989a1b5d8
Author: Ahmed Hussein <50...@users.noreply.github.com>
AuthorDate: Tue Oct 27 02:56:30 2020 -0500

    HDFS-15461. TestDFSClientRetries testGetFileChecksum fails (#2404)
    
    Co-authored-by: ahussein <ah...@verizonmedia.com>
    (cherry picked from commit afaab3d3325e0b454475fa01cc50f68007b0e15c)
---
 .../java/org/apache/hadoop/hdfs/TestDFSClientRetries.java    | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java
index e560522..f992a26 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSClientRetries.java
@@ -839,14 +839,18 @@ public class TestDFSClientRetries {
   public void testGetFileChecksum() throws Exception {
     final String f = "/testGetFileChecksum";
     final Path p = new Path(f);
-
-    final MiniDFSCluster cluster = new MiniDFSCluster.Builder(conf).numDataNodes(3).build();
+    // HDFS-15461: the number of datanode is higher than the number of replicas.
+    //             That way when a DN fails, the pipeline can recover.
+    final int numReplicas = 3;
+    final int numDatanodes = numReplicas + 1;
+    final MiniDFSCluster cluster =
+        new MiniDFSCluster.Builder(conf).numDataNodes(numDatanodes).build();
     try {
       cluster.waitActive();
 
-      //create a file
+      // create a file
       final FileSystem fs = cluster.getFileSystem();
-      DFSTestUtil.createFile(fs, p, 1L << 20, (short)3, 20100402L);
+      DFSTestUtil.createFile(fs, p, 1L << 20, (short) numReplicas, 20100402L);
 
       //get checksum
       final FileChecksum cs1 = fs.getFileChecksum(p);


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org