brumi1024 commented on code in PR #8641:
URL: https://github.com/apache/hadoop/pull/8641#discussion_r3786867268
##########
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/CapacitySchedulerConfigValidator.java:
##########
@@ -114,6 +120,68 @@ public static void validateVCores(Configuration conf) {
}
}
+ /**
+ * Validates that queue's partition capacity.
+ * It could only be configured if the queue is accessible by that label and
vice versa,
+ * the label that is accessible by the queue could not be removed if
+ * it has capacity or max-capacity configured in queue's partition
+ *
+ * @param conf Capacity Scheduler configuration to validate
+ * @throws IOException when the above rules have been violated
+ */
+ public static void validateQueueAccessibleLabels(Configuration conf) throws
IOException {
+ CapacitySchedulerConfiguration csConf = new
CapacitySchedulerConfiguration(conf);
+
+ for (String queuePath : csConf.getConfiguredNodeLabelsByQueue().keySet()) {
+ QueuePath queue = new QueuePath(queuePath);
+ if (queue.isRoot()) {
+ continue;
+ }
+
+ for (String label : csConf.getConfiguredNodeLabels(queue)) {
+ if (RMNodeLabelsManager.NO_LABEL.equals(label)
+ || !hasQueuePartitionCapacity(csConf, queue, label)
+ || isLabelAccessibleByQueue(csConf, queue, label)) {
+ continue;
+ }
+
+ throw new IOException("Queue: " + queuePath +
+ " must have accessible-node-labels and its capacity together");
+ }
+ }
+ }
+
+ private static boolean hasQueuePartitionCapacity(
+ CapacitySchedulerConfiguration conf, QueuePath queue, String label) {
+ String labelPrefix = QueuePrefixes.getNodeLabelPrefix(queue, label);
+ String capacity = conf.get(labelPrefix + CAPACITY);
+ if (capacity != null && !capacity.trim().isEmpty()) {
+ return true;
+ }
+ String maxCapacity = conf.get(labelPrefix + MAXIMUM_CAPACITY);
+ return maxCapacity != null && !maxCapacity.trim().isEmpty();
+ }
+
+ /**
+ * Requires queue in the queue-path to declare accessible-node-labels
explicitly.
+ * The inheritance from root’s implicit * label is not accepted here.
Review Comment:
So essentially the root's inherited access behavior will be removed?
I.e:
yarn.scheduler.capacity.root.queues=a,b
yarn.scheduler.capacity.root.a.capacity=50
yarn.scheduler.capacity.root.b.capacity=50
yarn.scheduler.capacity.root.a.accessible-node-labels.gpu.capacity=100
yarn.scheduler.capacity.root.b.accessible-node-labels.gpu.capacity=0
This config becomes invalid, blocking the CS startup. While it is arguable
that the current behavior is less than ideal, with this change we would
contradict the documentation, and break existing configs.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]