From 09bbbc8b866c8e289f7485443bceb96bdc0fad25 Mon Sep 17 00:00:00 2001 From: Wang Yuxuan <601377065@qq.com> Date: Mon, 22 Feb 2021 18:10:39 +0800 Subject: [PATCH] HDFS-15734. [READ] DirectoryScanner#scan need not check StorageType.PROVIDED (#2559) Co-authored-by: wangyuxuan (cherry picked from commit 1e32ab7d2fa83ad4119954b32a3a8daac9d08134) (cherry picked from commit 52a46f064a70505034367cffc32dfa1fabc7134b) Conflicts: hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java (cherry picked from commit fe822b525e4b9d5ebe58eb5f6d81af717f6290f3) --- .../apache/hadoop/hdfs/server/datanode/DirectoryScanner.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java index 4e0d247e8cb..02aa00bf88e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/DirectoryScanner.java @@ -441,8 +441,7 @@ public class DirectoryScanner implements Runnable { } // Block file and/or metadata file exists on the disk // Block exists in memory - if (info.getVolume().getStorageType() != StorageType.PROVIDED && - info.getBlockFile() == null) { + if (info.getBlockFile() == null) { // Block metadata file exits and block file is missing addDifference(diffRecord, statsRecord, info); } else if (info.getGenStamp() != memBlock.getGenerationStamp()