Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-18568

Correct metric of numRegions

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 3.0.0-alpha-1
    • 1.4.0, 2.0.0-alpha-3, 2.0.0, 1.2.7
    • metrics
    • None
    • Reviewed

    Description

      i found the value of metric numReigons in Regions is not correct.
      the metric can not add or remove region correctly as region close or open.
      the metric as follow:

      "name" : "Hadoop:service=HBase,name=RegionServer,sub=Regions",
      "numRegions" : 2,

      after trouble shooting ,i found the reason is in MetricsRegionSourceImpl#MetricsRegionSourceImpl

      agg.register(this);
      ...
      hashCode = regionWrapper.getRegionHashCode();
      

      when add the MetricsRegionSource to set ,but the hashCode has not yet initialized.
      So, the setFromMap can not put or remove the object correctly.
      it will be better like this :

      hashCode = regionWrapper.getRegionHashCode();
      agg.register(this);
      

      Attachments

        1. HBASE-18568-V1.patch
          2 kB
          Shibin Zhang

        Issue Links

          Activity

            People

              zhangshibin Shibin Zhang
              zhangshibin Shibin Zhang
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: