Uploaded image for project: 'Hadoop YARN'
  1. Hadoop YARN
  2. YARN-8443

Total #VCores in cluster metrics is wrong when CapacityScheduler reserved some containers

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.9.0, 3.1.0, 3.2.0
    • Fix Version/s: 3.2.0, 3.1.1, 2.9.2, 3.0.4
    • Component/s: webapp
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      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)

        Attachments

          Activity

            People

            • Assignee:
              Tao Yang Tao Yang
              Reporter:
              Tao Yang Tao Yang
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: