Merge -c 1529015 from trunk to branch-2 to fix YARN-890. Ensure CapacityScheduler doesn't round-up metric for available resources. Contributed by Xuan Gong & Hitesh Shah.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/branches/branch-2@1529018 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8a93fa55b6
commit
ee5313214c
|
@ -119,6 +119,9 @@ Release 2.1.2 - UNRELEASED
|
|||
YARN-876. Node resource is added twice when node comes back from unhealthy
|
||||
to healthy. (Peng Zhang via Sandy Ryza)
|
||||
|
||||
YARN-890. Ensure CapacityScheduler doesn't round-up metric for available
|
||||
resources. (Xuan Gong & Hitesh Shah via acmurthy)
|
||||
|
||||
Release 2.1.1-beta - 2013-09-23
|
||||
|
||||
INCOMPATIBLE CHANGES
|
||||
|
|
|
@ -103,11 +103,7 @@ class CSQueueUtils {
|
|||
childQueue.setUsedCapacity(usedCapacity);
|
||||
childQueue.setAbsoluteUsedCapacity(absoluteUsedCapacity);
|
||||
|
||||
Resource available =
|
||||
Resources.roundUp(
|
||||
calculator,
|
||||
Resources.subtract(queueLimit, usedResources),
|
||||
minimumAllocation);
|
||||
Resource available = Resources.subtract(queueLimit, usedResources);
|
||||
childQueue.getMetrics().setAvailableResourcesToQueue(
|
||||
Resources.max(
|
||||
calculator,
|
||||
|
|
|
@ -283,7 +283,8 @@ public class TestLeafQueue {
|
|||
|
||||
// Setup some nodes
|
||||
String host_0 = "127.0.0.1";
|
||||
FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 8*GB);
|
||||
FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0,
|
||||
8*GB);
|
||||
|
||||
final int numNodes = 1;
|
||||
Resource clusterResource =
|
||||
|
@ -300,7 +301,9 @@ public class TestLeafQueue {
|
|||
|
||||
// Only 1 container
|
||||
a.assignContainers(clusterResource, node_0);
|
||||
assertEquals(6*GB, a.getMetrics().getAvailableMB());
|
||||
assertEquals(
|
||||
(int)(node_0.getTotalResource().getMemory() * a.getCapacity()) - (1*GB),
|
||||
a.getMetrics().getAvailableMB());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -405,7 +408,8 @@ public class TestLeafQueue {
|
|||
|
||||
// Setup some nodes
|
||||
String host_0 = "127.0.0.1";
|
||||
FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0, 8*GB);
|
||||
FiCaSchedulerNode node_0 = TestUtils.getMockNode(host_0, DEFAULT_RACK, 0,
|
||||
8*GB);
|
||||
|
||||
final int numNodes = 1;
|
||||
Resource clusterResource =
|
||||
|
@ -493,12 +497,14 @@ public class TestLeafQueue {
|
|||
a.completedContainer(clusterResource, app_1, node_0, rmContainer,
|
||||
null, RMContainerEventType.KILL, null);
|
||||
}
|
||||
|
||||
assertEquals(0*GB, a.getUsedResources().getMemory());
|
||||
assertEquals(0*GB, app_0.getCurrentConsumption().getMemory());
|
||||
assertEquals(0*GB, app_1.getCurrentConsumption().getMemory());
|
||||
assertEquals(0*GB, a.getMetrics().getReservedMB());
|
||||
assertEquals(0*GB, a.getMetrics().getAllocatedMB());
|
||||
assertEquals(1*GB, a.getMetrics().getAvailableMB());
|
||||
assertEquals((int)(a.getCapacity() * node_0.getTotalResource().getMemory()),
|
||||
a.getMetrics().getAvailableMB());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Reference in New Issue