Details
Description
Cluster metrics on the web UI will give wrong Total Vcores when there is reserved container for CapacityScheduler.
Reference code:
ClusterMetricsInfo.java
if (rs instanceof CapacityScheduler) { CapacityScheduler cs = (CapacityScheduler) rs; this.totalMB = availableMB + allocatedMB + reservedMB; this.totalVirtualCores = availableVirtualCores + allocatedVirtualCores + containersReserved; ... }
The key of this problem is the calculation of totalVirtualCores, containersReserved is the number of reserved containers, not reserved VCores. The correct calculation expression of totalVirtualCores should be (availableVirtualCores + allocatedVirtualCores + reservedVirtualCores)