From c7ee6c151c5771043a6de3b8a951cea13f59dd7b Mon Sep 17 00:00:00 2001 From: Devaraj K Date: Mon, 8 Jun 2015 11:54:55 +0530 Subject: [PATCH] YARN-3780. Should use equals when compare Resource in RMNodeImpl#ReconnectNodeTransition. Contributed by zhihai xu. --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../hadoop/yarn/server/resourcemanager/rmnode/RMNodeImpl.java | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index d90433d31e..59e3509adf 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -501,6 +501,9 @@ Release 2.8.0 - UNRELEASED YARN-3655. FairScheduler: potential livelock due to maxAMShare limitation and container reservation. (Zhihai Xu via kasha) + YARN-3780. Should use equals when compare Resource in RMNodeImpl#ReconnectNodeTransition. + (zhihai xu via devaraj) + Release 2.7.1 - UNRELEASED INCOMPATIBLE CHANGES diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmnode/RMNodeImpl.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmnode/RMNodeImpl.java index 1263692173..8a810cb9ca 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmnode/RMNodeImpl.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/rmnode/RMNodeImpl.java @@ -622,7 +622,8 @@ public void transition(RMNodeImpl rmNode, RMNodeEvent event) { rmNode.httpPort = newNode.getHttpPort(); rmNode.httpAddress = newNode.getHttpAddress(); boolean isCapabilityChanged = false; - if (rmNode.getTotalCapability() != newNode.getTotalCapability()) { + if (!rmNode.getTotalCapability().equals( + newNode.getTotalCapability())) { rmNode.totalCapability = newNode.getTotalCapability(); isCapabilityChanged = true; }