From fdb56f74f38cabb0f94e0781fcedb1594904c026 Mon Sep 17 00:00:00 2001 From: Vinayakumar B Date: Thu, 27 Aug 2015 13:06:43 +0530 Subject: [PATCH] HDFS-8682. Should not remove decommissioned node,while calculating the number of live/dead decommissioned node. (Contributed by J. Andreina) --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index e432da0cc1..42eed140de 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -1228,6 +1228,9 @@ Release 2.8.0 - UNRELEASED HDFS-8932. NPE thrown in NameNode when try to get TotalSyncCount metric before editLogStream initialization. (Surendra Singh Lilhore via xyao) + HDFS-8682. Should not remove decommissioned node,while calculating the + number of live/dead decommissioned node. (J. Andreina via vinayakumarb) + Release 2.7.2 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java index f1738bbbeb..f4952f7803 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java @@ -5070,7 +5070,7 @@ public int getNumDeadDataNodes() { @Override // FSNamesystemMBean public int getNumDecomLiveDataNodes() { final List live = new ArrayList(); - getBlockManager().getDatanodeManager().fetchDatanodes(live, null, true); + getBlockManager().getDatanodeManager().fetchDatanodes(live, null, false); int liveDecommissioned = 0; for (DatanodeDescriptor node : live) { liveDecommissioned += node.isDecommissioned() ? 1 : 0; @@ -5081,7 +5081,7 @@ public int getNumDecomLiveDataNodes() { @Override // FSNamesystemMBean public int getNumDecomDeadDataNodes() { final List dead = new ArrayList(); - getBlockManager().getDatanodeManager().fetchDatanodes(null, dead, true); + getBlockManager().getDatanodeManager().fetchDatanodes(null, dead, false); int deadDecommissioned = 0; for (DatanodeDescriptor node : dead) { deadDecommissioned += node.isDecommissioned() ? 1 : 0;