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

Log deletion is not removing log metrics

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Duplicate
    • 0.8.2.1
    • 0.9.0.0
    • log

    Description

      Topic deletion does not remove associated metrics. Any configured kafka metric reporter that gets triggered after a topic is deleted, when polling for log metrics for such deleted logs it will throw something like:

      java.util.NoSuchElementException
          at java.util.concurrent.ConcurrentSkipListMap$Iter.advance(ConcurrentSkipListMap.java:2299)
          at java.util.concurrent.ConcurrentSkipListMap$ValueIterator.next(ConcurrentSkipListMap.java:2326)
          at scala.collection.convert.Wrappers$JIteratorWrapper.next(Wrappers.scala:43)
          at scala.collection.IterableLike$class.head(IterableLike.scala:107)
          at scala.collection.AbstractIterable.head(Iterable.scala:54)
          at kafka.log.Log.logStartOffset(Log.scala:502)
          at kafka.log.Log$$anon$2.value(Log.scala:86)
          at kafka.log.Log$$anon$2.value(Log.scala:85)
      

      since on log deletion, Log segments collection get cleared, so logSegments Iterable has no (next) elements.

      Known workaround is to restart broker - as metric registry is in memory, not persisted, on restart it will be recreated with metrics for existing/non-deleted topics only.

      Attachments

        Issue Links

          Activity

            People

              jkreps Jay Kreps
              sslavic Stevo Slavić
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: