gerashegalov commented on code in PR #8752:
URL: https://github.com/apache/hadoop/pull/8752#discussion_r4673422190
##########
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:
##########
@@ -911,25 +914,30 @@ private ContainerAllocation allocate(Resource
clusterResource,
resourceLimits, schedulerKey, reservedContainer);
if (AllocationState.ALLOCATED == result.getAllocationState()) {
- result = doAllocation(result, node, schedulerKey, reservedContainer);
- break;
+ return doAllocation(result, node, schedulerKey, reservedContainer);
}
// In MultiNodePlacement, Try Allocate on other Available nodes
// from Iterator as well before Reserving. Else there won't be any
// Allocate of new containers when the first node in the
// iterator could not fit and returns RESERVED allocation.
if (AllocationState.RESERVED == result.getAllocationState()) {
- lastReservation = result;
- if (iter.hasNext()) {
+ if (nodeReservedContainer != null
+ && nodeReservedContainer != reservedContainer) {
+ // A new reservation cannot commit on an already-reserved node.
+ result = ContainerAllocation.PRIORITY_SKIPPED;
Review Comment:
Nit (optional): `assignContainer` has already recorded this node as
`ActivityState.RESERVED` (around L663). When the guard turns the result into a
skip, the scheduler activities output
(`/ws/v1/cluster/scheduler/app-activities`) still shows a reservation on this
node, but none was proposed.
Consider recording a skip here, as the opt-in reserved-node skip a few lines
above does with
`ActivitiesLogger.APP.recordSkippedAppActivityWithoutAllocation(...,
ActivityDiagnosticConstant.NODE_HAS_BEEN_RESERVED, ActivityLevel.NODE)`. A
`LOG.debug` would also help. This only affects diagnostics, not scheduling, so
it's fine to leave as is.
--
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]