Correction - restart did help, those exceptions are not logged anymore.
Still, it seems there is a bug in topic deletion, some kafka.log.Log
references continue to live after topic is deleted, until broker is
restarted.
Will try to create reproducible failing test.

On Fri, May 29, 2015 at 11:50 PM, Stevo Slavić <[email protected]> wrote:

> Hello Kafka community,
>
> We had a ton of test topics, and deleted them using Kafka admin scripts -
> then our metrics error log started filling up with exceptions.
> Kafka metric reporter is trying to read LogStartOffset gauge value, and
> that throws NoSuchElementException.
>
> 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)
>
> Kafka version is 0.8.2.1 and this is logStartOffset method implementation:
>
> def logStartOffset: Long = logSegments.head.baseOffset
>
> It assumes logSegments is non empty. I see in few places in kafka.log.Log
> methods are trying to ensure that there is always at least one segment.
>
> I guess not all possible cases are covered, so it can happen that Log has
> 0 logSegments.
> Not even restart of all Kafka brokers in the cluster didn't help.
>
> Any suggestions how to workaround this are welcome.
>
> Kind regards,
> Stevo Slavic.
>
>

Reply via email to