Uploaded image for project: 'Kafka'
  1. Kafka
  2. KAFKA-3632

ConsumerLag metrics persist after partition migration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 0.8.2.2, 0.9.0.1
    • 0.9.0.2, 0.10.0.0
    • core
    • None
    • JDK 1.8, Linux

    Description

      When a partition is migrated away from a broker, the ConsumerLag metric for the topic/partition gets 'stuck' at the current value. The only way to remove the metric is to restart the broker.

      This appears to be because in AbstractFetcherThread.scala there is no way of removing a metric. See...

      class FetcherLagStats(metricId: ClientIdAndBroker) { 
      private val valueFactory = (k: ClientIdTopicPartition) => new FetcherLagMetrics(k) 
      val stats = new Pool[ClientIdTopicPartition, FetcherLagMetrics](Some(valueFactory))
      
      def getFetcherLagStats(topic: String, partitionId: Int): FetcherLagMetrics = { 
      stats.getAndMaybePut(new ClientIdTopicPartition(metricId.clientId, topic, partitionId)) 
      } 
      }
      

      Attachments

        Issue Links

          Activity

            People

              hachikuji Jason Gustafson
              blueck Brian Lueck
              Ismael Juma Ismael Juma
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: