From f88f47166145ee294f32383c9862947e5e0c71db Mon Sep 17 00:00:00 2001 From: Prabhu Joseph Date: Tue, 22 Oct 2019 19:44:32 +0530 Subject: [PATCH] YARN-9925. Fails unsupported queue hierarchy. CapacityScheduler currently does not support full queue path. It fails when adding queue with same name as an existing parent queue - "Queue's cannot be moved from one hierarchy to other also". Some cases are not hanlded and which fails while submission of job - "Failed to submit application to non-leaf queue". This patch completely avoids adding a queue with same name as an existing queue to fix the same. This check can be removed once CapacityScheduler supports full queue path (YARN-7621). --- .../scheduler/capacity/CapacitySchedulerQueueManager.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 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/CapacitySchedulerQueueManager.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/CapacitySchedulerQueueManager.java index 7dca824..066af74 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/CapacitySchedulerQueueManager.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/CapacitySchedulerQueueManager.java @@ -288,11 +288,10 @@ static CSQueue parseQueue( } - if (queue instanceof LeafQueue && queues.containsKey(queueName) && queues - .get(queueName) instanceof LeafQueue) { - throw new IOException("Two leaf queues were named " + queueName - + ". Leaf queue names must be distinct"); - } + if (queues.containsKey(queueName)) { + throw new IOException("Two queues " + fullQueueName + " and " + + queues.get(queueName).getQueuePath() + + " named with same queue name. Queue names must be distinct"); queues.put(queueName, queue); LOG.info("Initialized queue: " + queue); -- 2.7.4 (Apple Git-66)