YARN-2111. In FairScheduler.attemptScheduling, we don't count containers as assigned if they have 0 memory but non-zero cores (Sandy Ryza)
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1605115 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
c8dfed19ba
commit
d66a477781
|
@ -255,6 +255,9 @@ Release 2.5.0 - UNRELEASED
|
||||||
YARN-2187. FairScheduler: Disable max-AM-share check by default.
|
YARN-2187. FairScheduler: Disable max-AM-share check by default.
|
||||||
(Robert Kanter via kasha)
|
(Robert Kanter via kasha)
|
||||||
|
|
||||||
|
YARN-2111. In FairScheduler.attemptScheduling, we don't count containers
|
||||||
|
as assigned if they have 0 memory but non-zero cores (Sandy Ryza)
|
||||||
|
|
||||||
Release 2.4.1 - 2014-06-23
|
Release 2.4.1 - 2014-06-23
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
|
|
@ -1033,8 +1033,7 @@ public class FairScheduler extends
|
||||||
int assignedContainers = 0;
|
int assignedContainers = 0;
|
||||||
while (node.getReservedContainer() == null) {
|
while (node.getReservedContainer() == null) {
|
||||||
boolean assignedContainer = false;
|
boolean assignedContainer = false;
|
||||||
if (Resources.greaterThan(RESOURCE_CALCULATOR, clusterResource,
|
if (!queueMgr.getRootQueue().assignContainer(node).equals(
|
||||||
queueMgr.getRootQueue().assignContainer(node),
|
|
||||||
Resources.none())) {
|
Resources.none())) {
|
||||||
assignedContainers++;
|
assignedContainers++;
|
||||||
assignedContainer = true;
|
assignedContainer = true;
|
||||||
|
|
|
@ -1662,6 +1662,41 @@ public class TestFairScheduler extends FairSchedulerTestBase {
|
||||||
.getLiveContainers().size());
|
.getLiveContainers().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test(timeout = 3000)
|
||||||
|
public void testMaxAssignWithZeroMemoryContainers() throws Exception {
|
||||||
|
conf.setBoolean(FairSchedulerConfiguration.ASSIGN_MULTIPLE, true);
|
||||||
|
conf.setInt(YarnConfiguration.RM_SCHEDULER_MINIMUM_ALLOCATION_MB, 0);
|
||||||
|
|
||||||
|
scheduler.init(conf);
|
||||||
|
scheduler.start();
|
||||||
|
scheduler.reinitialize(conf, resourceManager.getRMContext());
|
||||||
|
|
||||||
|
RMNode node =
|
||||||
|
MockNodes.newNodeInfo(1, Resources.createResource(16384, 16), 0,
|
||||||
|
"127.0.0.1");
|
||||||
|
NodeAddedSchedulerEvent nodeEvent = new NodeAddedSchedulerEvent(node);
|
||||||
|
NodeUpdateSchedulerEvent updateEvent = new NodeUpdateSchedulerEvent(node);
|
||||||
|
scheduler.handle(nodeEvent);
|
||||||
|
|
||||||
|
ApplicationAttemptId attId =
|
||||||
|
createSchedulingRequest(0, 1, "root.default", "user", 8);
|
||||||
|
FSSchedulerApp app = scheduler.getSchedulerApp(attId);
|
||||||
|
|
||||||
|
// set maxAssign to 2: only 2 containers should be allocated
|
||||||
|
scheduler.maxAssign = 2;
|
||||||
|
scheduler.update();
|
||||||
|
scheduler.handle(updateEvent);
|
||||||
|
assertEquals("Incorrect number of containers allocated", 2, app
|
||||||
|
.getLiveContainers().size());
|
||||||
|
|
||||||
|
// set maxAssign to -1: all remaining containers should be allocated
|
||||||
|
scheduler.maxAssign = -1;
|
||||||
|
scheduler.update();
|
||||||
|
scheduler.handle(updateEvent);
|
||||||
|
assertEquals("Incorrect number of containers allocated", 8, app
|
||||||
|
.getLiveContainers().size());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Test to verify the behavior of
|
* Test to verify the behavior of
|
||||||
* {@link FSQueue#assignContainer(FSSchedulerNode)})
|
* {@link FSQueue#assignContainer(FSSchedulerNode)})
|
||||||
|
|
Loading…
Reference in New Issue