Pārlūkot izejas kodu

Fixing scheduling deadlock in AM because of incorrect headRoom values from RM. The bug happens when AM releases containers and RM decrements current memory usage twice for all those containers. Contributed by Vinod Kumar Vavilapalli.

git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/MR-279@1137519 13f79535-47bb-0310-9956-ffa450edef68
Vinod Kumar Vavilapalli 14 gadi atpakaļ
vecāks
revīzija
e22b726bb8

+ 4 - 0
mapreduce/CHANGES.txt

@@ -5,6 +5,10 @@ Trunk (unreleased changes)
 
     MAPREDUCE-279
 
+    Fixing scheduling deadlock in AM because of incorrect headRoom values from
+    RM. The bug happens when AM releases containers and RM decrements current
+    memory usage twice for all those containers. (vinodkv)
+
     Disabling locality-wait in CapacityScheduler for now to prevent uber-slow
     scheduling for apps with no data-locality constraints (sleep-job like). (vinodkv)
 

+ 3 - 1
mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/Application.java

@@ -243,7 +243,9 @@ public class Application {
     for (Container container : release) {
       LOG.debug("update: " + "application=" + applicationId + " released="
           + container);
-      Resources.subtractFrom(currentConsumption, container.getResource());
+      // TOday in all code paths, this is taken by completedContainer called by
+      // the caller. So commenting this.
+      // Resources.subtractFrom(currentConsumption, container.getResource());
       for (Iterator<Container> i = acquired.iterator(); i.hasNext();) {
         Container c = i.next();
         if (c.getId().equals(container.getId())) {

+ 18 - 0
mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/NodeManager.java

@@ -1,3 +1,21 @@
+/**
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
 package org.apache.hadoop.yarn.server.resourcemanager.scheduler;
 
 import java.util.List;

+ 1 - 1
mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/NodeManagerImpl.java

@@ -52,7 +52,7 @@ import org.apache.hadoop.yarn.server.resourcemanager.resourcetracker.NodeInfo;
 @Private
 @Unstable
 public class NodeManagerImpl implements NodeManager {
-  private static final Log LOG = LogFactory.getLog(NodeManager.class);
+  private static final Log LOG = LogFactory.getLog(NodeManagerImpl.class);
   private static final RecordFactory recordFactory = RecordFactoryProvider.getRecordFactory(null);
   private final NodeId nodeId;
   private final String hostName;

+ 1 - 1
mapreduce/yarn/yarn-server/yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/LeafQueue.java

@@ -910,7 +910,7 @@ public class LeafQueue implements Queue {
           unreserve(application, priority, node);
         }
         
-        LOG.info("allocatedContainer" +
+        LOG.info("assignedContainer" +
             " application=" + application.getApplicationId() +
             " container=" + container + 
             " queue=" + this.toString() +