YARN-10997. Revisit allocation and reservation logging. Contributed by Andras Gyori

This commit is contained in:
Szilard Nemeth 2021-11-12 15:42:14 +01:00
parent 7fb1bb8f35
commit 7cb887e6c2
2 changed files with 9 additions and 6 deletions

View File

@ -3294,13 +3294,11 @@ public boolean tryCommit(Resource cluster, ResourceCommitRequest r,
long commitSuccess = System.nanoTime() - commitStart;
CapacitySchedulerMetrics.getMetrics()
.addCommitSuccess(commitSuccess);
LOG.info("Allocation proposal accepted");
isSuccess = true;
} else{
long commitFailed = System.nanoTime() - commitStart;
CapacitySchedulerMetrics.getMetrics()
.addCommitFailure(commitFailed);
LOG.info("Failed to accept allocation proposal");
}
LOG.debug("Allocation proposal accepted={}, proposal={}", isSuccess,

View File

@ -357,6 +357,7 @@ private boolean commonCheckContainerAllocation(
// adding NP check as this proposal could not be allocated from reserved
// container in async-scheduling mode
if (allocation.getAllocateFromReservedContainer() == null) {
LOG.debug("Trying to allocate from reserved container in async scheduling mode");
return false;
}
RMContainer fromReservedContainer =
@ -572,6 +573,8 @@ public boolean apply(Resource cluster, ResourceCommitRequest<FiCaSchedulerApp,
if (updatePending &&
getOutstandingAsksCount(schedulerContainer.getSchedulerRequestKey())
<= 0) {
LOG.debug("Rejecting appliance of allocation due to existing pending allocation " +
"request for " + schedulerContainer);
return false;
}
@ -670,10 +673,12 @@ public boolean apply(Resource cluster, ResourceCommitRequest<FiCaSchedulerApp,
schedulerContainer.getRmContainer().getContainer(),
reReservation);
LOG.info("Reserved container=" + rmContainer.getContainerId()
+ ", on node=" + schedulerContainer.getSchedulerNode()
+ " with resource=" + rmContainer
.getAllocatedOrReservedResource());
if (LOG.isDebugEnabled()) {
LOG.debug("Reserved container=" + rmContainer.getContainerId()
+ ", on node=" + schedulerContainer.getSchedulerNode()
+ " with resource=" + rmContainer
.getAllocatedOrReservedResource());
}
}
}
} finally {