brumi1024 commented on a change in pull request #4105:
URL: https://github.com/apache/hadoop/pull/4105#discussion_r836415787
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java
##########
@@ -4412,6 +4412,9 @@ public static boolean areNodeLabelsEnabled(
public static final String AM_DEFAULT_NODE_LABEL =
RM_NODE_LABELS_PREFIX + "am.default-node-label-expression";
+ public static final String ALLOWED_AM_NON_EXCLUSIVE_ALLOCATION =
+ RM_NODE_LABELS_PREFIX + "am.allowed-non-exclusive-allocation";
+
Review comment:
Based on the actual property name I think
AM_ALLOWED_NON_EXCLUSIVE_ALLOCATION would be better. Or simply using
am.allow-non-exclusive-allocation might sound more natural.
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/scheduler/capacity/allocator/RegularContainerAllocator.java
##########
@@ -121,10 +123,9 @@ private ContainerAllocation
preCheckForNodeCandidateSet(FiCaSchedulerNode node,
return ContainerAllocation.PRIORITY_SKIPPED;
}
- // AM container allocation doesn't support non-exclusive allocation to
- // avoid painful of preempt an AM container
if (schedulingMode == SchedulingMode.IGNORE_PARTITION_EXCLUSIVITY) {
- if (application.isWaitingForAMContainer()) {
+ if (application.isWaitingForAMContainer() &&
!rmContext.getYarnConfiguration()
+ .getBoolean(ALLOWED_AM_NON_EXCLUSIVE_ALLOCATION, false)) {
Review comment:
Can you please add a unit test for this? I know it's a small change, but
a test might make the scenario more understandable (and ensures that a later
change doesn't break this).
##########
File path:
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-common/src/main/resources/yarn-default.xml
##########
@@ -3452,6 +3452,14 @@
<value>30000</value>
</property>
+ <property>
+ <description>
+ Flag to indicate whether the AM can be allocated to non-exclusive nodes
or not.
Review comment:
Please indicate the default value in the description as well.
--
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]