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

(cherry picked from commit 7cb887e6c2)
This commit is contained in:
Szilard Nemeth 2021-11-12 15:42:14 +01:00 committed by Eric Payne
parent 690337bca9
commit ebe3ed5cd3
2 changed files with 9 additions and 6 deletions

View File

@ -3131,13 +3131,11 @@ public class CapacityScheduler extends
long commitSuccess = System.nanoTime() - commitStart; long commitSuccess = System.nanoTime() - commitStart;
CapacitySchedulerMetrics.getMetrics() CapacitySchedulerMetrics.getMetrics()
.addCommitSuccess(commitSuccess); .addCommitSuccess(commitSuccess);
LOG.info("Allocation proposal accepted");
isSuccess = true; isSuccess = true;
} else{ } else{
long commitFailed = System.nanoTime() - commitStart; long commitFailed = System.nanoTime() - commitStart;
CapacitySchedulerMetrics.getMetrics() CapacitySchedulerMetrics.getMetrics()
.addCommitFailure(commitFailed); .addCommitFailure(commitFailed);
LOG.info("Failed to accept allocation proposal");
} }
LOG.debug("Allocation proposal accepted={}, proposal={}", isSuccess, LOG.debug("Allocation proposal accepted={}, proposal={}", isSuccess,

View File

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