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

ConsumerLag metrics persist after partition migration

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 0.8.2.2, 0.9.0.1
    • Fix Version/s: 0.9.0.2, 0.10.0.0
    • Component/s: core
    • Labels:
      None
    • Environment:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: