Uploaded image for project: 'Ambari'
  1. Ambari
  2. AMBARI-25998

Host uuid is not getting synced to other collectors, causing NPE while accessing metric

    XMLWordPrintableJSON

Details

    Description

      Host uuid is not getting synced with other collectors, causing NPE while accessing metric

      java.lang.NullPointerException
              at org.apache.ambari.metrics.core.timeline.PhoenixHBaseAccessor.getLastTimelineMetricFromResultSet(PhoenixHBaseAccessor.java:457)
              at org.apache.ambari.metrics.core.timeline.PhoenixHBaseAccessor.getLatestMetricRecords(PhoenixHBaseAccessor.java:1150)
              at org.apache.ambari.metrics.core.timeline.PhoenixHBaseAccessor.getMetricRecords(PhoenixHBaseAccessor.java:966)
              at org.apache.ambari.metrics.core.timeline.HBaseTimelineMetricsService.getTimelineMetrics(HBaseTimelineMetricsService.java:294)
              at org.apache.ambari.metrics.webapp.TimelineWebServices.getTimelineMetrics(TimelineWebServices.java:267)
      

      Steps to reproduce the issue

      1. Push below metrics through collector-1

      {
        "metrics": [
          {
            "metricname": "cpu1",
            "appid": "app1",
            "hostname": "host1",
            "starttime": 1693294119309,
            "metrics": {
              "1693294119309": 100,
              "1693294129309": 200
            }
          }
        ]
      }
      

      After metadata sync interval elapsed, performed following operations
      2. GET http://COLLECTOR-1-HOST:6188/ws/v1/timeline/metrics/hosts returned

      {
          "host1": [
              "app1"
          ],
      ...
      }
      

      3. GET http://COLLECTOR-2-HOST:6188/ws/v1/timeline/metrics/hosts returned

      { "host1": [ "app1" ], ... }

      4. GET http://COLLECTOR-1-HOST:6188/ws/v1/timeline/metrics?metricNames=cpu1&appId=app1&hostname=host1 returned
      {
      "metrics": [
      {
      "metricname": "cpu1",
      "appid": "app1",
      "hostname": "host1",
      "timestamp": 0,
      "starttime": 1693294119309,
      "metrics":

      { "1693294129309": 200.0 }

      ,
      "metadata": {}
      }
      ]
      }

      5. GET http://COLLECTOR-2-HOST:6188/ws/v1/timeline/metrics?metricNames=cpu1&appId=app1&hostname=host1 returned

      {
          "exception": "NullPointerException",
          "javaClassName": "java.lang.NullPointerException"
      }
      

      When host name is being synced, host id also should be synced to fix this issue.
      Similar to this issue another issue https://issues.apache.org/jira/browse/AMBARI-25963 was raised, but that NPE was because metrics uuid was not synced, this issue is because of host uuid is not synced.

      Attachments

        Activity

          People

            arshad.mohammad Mohammad Arshad
            arshad.mohammad Mohammad Arshad
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 0.5h
                0.5h