hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weic...@apache.org
Subject hadoop git commit: HDFS-12891. Do not invalidate blocks if toInvalidate is empty. Contributed by Zsolt Venczel.
Date Tue, 12 Dec 2017 00:43:07 GMT
Repository: hadoop
Updated Branches:
  refs/heads/trunk 5cd1056ad -> 55fc2d648


HDFS-12891. Do not invalidate blocks if toInvalidate is empty. Contributed by Zsolt Venczel.


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

Branch: refs/heads/trunk
Commit: 55fc2d6485702a99c6d4bb261a720d1f0498af2b
Parents: 5cd1056
Author: Wei-Chiu Chuang <weichiu@apache.org>
Authored: Mon Dec 11 16:42:25 2017 -0800
Committer: Wei-Chiu Chuang <weichiu@apache.org>
Committed: Mon Dec 11 16:43:03 2017 -0800

----------------------------------------------------------------------
 .../hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/55fc2d64/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java
index 75561ca..ff68c02 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/InvalidateBlocks.java
@@ -293,10 +293,12 @@ class InvalidateBlocks {
       getBlocksToInvalidateByLimit(nodeToECBlocks.get(dn),
           toInvalidate, numECBlocks, remainingLimit);
     }
-    if (toInvalidate.size() > 0 && getBlockSetsSize(dn) == 0) {
-      remove(dn);
+    if (toInvalidate.size() > 0) {
+      if (getBlockSetsSize(dn) == 0) {
+        remove(dn);
+      }
+      dn.addBlocksToBeInvalidated(toInvalidate);
     }
-    dn.addBlocksToBeInvalidated(toInvalidate);
     return toInvalidate;
   }
   


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


Mime
View raw message