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
- is related to
-
KAFKA-1866 LogStartOffset gauge throws exceptions after log.delete()
- Resolved