From 2c60bcb1c2a03bdb549d0f8974809efc11d84860 Mon Sep 17 00:00:00 2001 From: Szilard Nemeth Date: Wed, 27 May 2020 13:07:01 +0200 Subject: [PATCH] Revert "FS-CS converter: nestedUserQueue with default rule results in invalid queue mapping. Contributed by Gergely Pollak" This reverts commit 9ce913a7bf720944d0305960bbf1899461b8628b. Reverting because of missing Jira-ID in the commit message --- .../scheduler/capacity/CapacityScheduler.java | 6 ++-- ...estCapacitySchedulerAutoQueueCreation.java | 29 ------------------- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java index eb0bb9aa32..cca4fe1872 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacityScheduler.java @@ -989,14 +989,12 @@ private void addApplication(ApplicationId applicationId, String queueName, // not auto-created above, then its parent queue should match // the parent queue specified in queue mapping } else if (!queue.getParent().getQueueShortName().equals( - placementContext.getParentQueue()) - && !queue.getParent().getQueuePath().equals( - placementContext.getParentQueue())) { + placementContext.getParentQueue())) { String message = "Auto created Leaf queue " + placementContext.getQueue() + " " + "already exists under queue : " + queue .getParent().getQueueShortName() - + ". But Queue mapping configuration " + + + ".But Queue mapping configuration " + CapacitySchedulerConfiguration.QUEUE_MAPPING + " has been " + "updated to a different parent queue : " + placementContext.getParentQueue() diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacitySchedulerAutoQueueCreation.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacitySchedulerAutoQueueCreation.java index a2267ecac9..a98abb9a00 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacitySchedulerAutoQueueCreation.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/test/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/TestCapacitySchedulerAutoQueueCreation.java @@ -162,35 +162,6 @@ public void testAutoCreateLeafQueueCreation() throws Exception { } } - @Test(timeout = 20000) - public void testAutoCreateLeafQueueCreationUsingFullParentPath() - throws Exception { - - try { - setupGroupQueueMappings("root.d", cs.getConfiguration(), "%user"); - cs.reinitialize(cs.getConfiguration(), mockRM.getRMContext()); - - submitApp(mockRM, cs.getQueue("d"), TEST_GROUPUSER, TEST_GROUPUSER, 1, 1); - AutoCreatedLeafQueue autoCreatedLeafQueue = - (AutoCreatedLeafQueue) cs.getQueue(TEST_GROUPUSER); - ManagedParentQueue parentQueue = (ManagedParentQueue) cs.getQueue("d"); - assertEquals(parentQueue, autoCreatedLeafQueue.getParent()); - - Map expectedChildQueueAbsCapacity = - new HashMap() {{ - put(NO_LABEL, 0.02f); - }}; - - validateInitialQueueEntitlement(parentQueue, TEST_GROUPUSER, - expectedChildQueueAbsCapacity, - new HashSet() {{ add(NO_LABEL); }}); - - } finally { - cleanupQueue(USER0); - cleanupQueue(TEST_GROUPUSER); - } - } - @Test public void testReinitializeStoppedAutoCreatedLeafQueue() throws Exception { try {