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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.9.0, 3.1.0, 3.2.0
    • 3.2.0, 3.1.1, 2.9.2, 3.0.4
    • webapp
    • None
    • 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

        1. YARN-8443.001.patch
          1 kB
          Tao Yang

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: