YARN-271. Fair scheduler hits IllegalStateException trying to reserve different apps on same node. Contributed by Sandy Ryza.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1424945 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
557b022406
commit
ee007d3f38
@ -140,6 +140,9 @@ Release 2.0.3-alpha - Unreleased
|
||||
YARN-264. y.s.rm.DelegationTokenRenewer attempts to renew token even
|
||||
after removing an app. (kkambatl via tucu)
|
||||
|
||||
YARN-271. Fair scheduler hits IllegalStateException trying to reserve
|
||||
different apps on same node. (Sandy Ryza via tomwhite)
|
||||
|
||||
Release 2.0.2-alpha - 2012-09-07
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
@ -777,7 +777,8 @@ private synchronized void nodeUpdate(RMNode nm,
|
||||
boolean assignedContainer = false;
|
||||
for (FSLeafQueue sched : scheds) {
|
||||
Resource assigned = sched.assignContainer(node, false);
|
||||
if (Resources.greaterThan(assigned, Resources.none())) {
|
||||
if (Resources.greaterThan(assigned, Resources.none()) ||
|
||||
node.getReservedContainer() != null) {
|
||||
eventLog.log("ASSIGN", nm.getHostName(), assigned);
|
||||
assignedContainers++;
|
||||
assignedContainer = true;
|
||||
|
@ -1098,4 +1098,31 @@ public void testPreemptionDecision() throws Exception {
|
||||
assertTrue(Resources.equals(
|
||||
Resources.createResource(1536), scheduler.resToPreempt(schedD, clock.getTime())));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testMultipleContainersWaitingForReservation() {
|
||||
// Add a node
|
||||
RMNode node1 = MockNodes.newNodeInfo(1, Resources.createResource(1024));
|
||||
NodeAddedSchedulerEvent nodeEvent1 = new NodeAddedSchedulerEvent(node1);
|
||||
scheduler.handle(nodeEvent1);
|
||||
|
||||
// Request full capacity of node
|
||||
createSchedulingRequest(1024, "queue1", "user1", 1);
|
||||
scheduler.update();
|
||||
NodeUpdateSchedulerEvent updateEvent = new NodeUpdateSchedulerEvent(node1,
|
||||
new ArrayList<ContainerStatus>(), new ArrayList<ContainerStatus>());
|
||||
scheduler.handle(updateEvent);
|
||||
|
||||
ApplicationAttemptId attId1 = createSchedulingRequest(1024, "queue2", "user2", 1);
|
||||
ApplicationAttemptId attId2 = createSchedulingRequest(1024, "queue3", "user3", 1);
|
||||
|
||||
scheduler.update();
|
||||
scheduler.handle(updateEvent);
|
||||
|
||||
// One container should get reservation and the other should get nothing
|
||||
assertEquals(1024,
|
||||
scheduler.applications.get(attId1).getCurrentReservation().getMemory());
|
||||
assertEquals(0,
|
||||
scheduler.applications.get(attId2).getCurrentReservation().getMemory());
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user