From d082b122f9bdd5d75174242ff4fd65242959696a Mon Sep 17 00:00:00 2001 From: Karthik Kambatla Date: Thu, 6 Feb 2014 23:31:04 +0000 Subject: [PATCH] MAPREDUCE-5744. Job hangs because RMContainerAllocator.preemptReduce() violates the comparator contract (Gera Shegalov via kasha) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1565479 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-mapreduce-project/CHANGES.txt | 4 ++++ .../hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hadoop-mapreduce-project/CHANGES.txt b/hadoop-mapreduce-project/CHANGES.txt index a82bb36ded7..59804e95a66 100644 --- a/hadoop-mapreduce-project/CHANGES.txt +++ b/hadoop-mapreduce-project/CHANGES.txt @@ -91,6 +91,10 @@ Release 2.3.0 - UNRELEASED MAPREDUCE-5725. Make explicit that TestNetworkedJob relies on the Capacity Scheduler (Sandy Ryza) + MAPREDUCE-5744. Job hangs because + RMContainerAllocator$AssignedRequests.preemptReduce() violates the + comparator contract (Gera Shegalov via kasha) + OPTIMIZATIONS MAPREDUCE-4680. Job history cleaner should only check timestamps of files in diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java index 3c52dcdc00b..17cd19a2210 100644 --- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java +++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app/src/main/java/org/apache/hadoop/mapreduce/v2/app/rm/RMContainerAllocator.java @@ -1123,9 +1123,9 @@ public class RMContainerAllocator extends RMContainerRequestor new Comparator() { @Override public int compare(TaskAttemptId o1, TaskAttemptId o2) { - float p = getJob().getTask(o1.getTaskId()).getAttempt(o1).getProgress() - - getJob().getTask(o2.getTaskId()).getAttempt(o2).getProgress(); - return p >= 0 ? 1 : -1; + return Float.compare( + getJob().getTask(o1.getTaskId()).getAttempt(o1).getProgress(), + getJob().getTask(o2.getTaskId()).getAttempt(o2).getProgress()); } });