accumulo-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ivan Bella (JIRA)" <>
Subject [jira] [Commented] (ACCUMULO-4502) Called next when there is no top
Date Mon, 24 Oct 2016 17:56:58 GMT


Ivan Bella commented on ACCUMULO-4502:

The condition in the HeapIterator is that the topIdx == null which implies that hasTop should
have returned false.

In PartialMutationSkippingIterator.consume it is simply doing the following:

protected void consume() throws IOException
  while (getSource().hasTop() && ((MemKey) getSource().getTopKey()).kvCount > kvCount)

So obviously it is calling hasTop() before calling next().  The rub is that there is a SourceSwitchingIterator
in between the PartialMutationSkippingIterator and the HeapIterator at the bottom.  Most likely
a minor compaction caused the SourceSwitchingIterator to switch via the switchNow method.
 When that happens the following code in _switchNow() is invoked:

if (switchSource()) {
  if (key != null) {

So if getSource().getTop() was invoked in the PartialMutationSkippingIterator, then switchSource
is called but BEFORE the nested if (key != null) { } is invoked, the getSource().next()
is invoked by the PartialMutationSkippingIterator.  This scenario would leave the topIdx to
be null in the HeapIterator (most likely the RFile.Reader at this point) and subsequently
cause this exception.

> Called next when there is no top
> --------------------------------
>                 Key: ACCUMULO-4502
>                 URL:
>             Project: Accumulo
>          Issue Type: Bug
>          Components: core, tserver
>    Affects Versions: 1.6.6
>            Reporter: Ivan Bella
> This happens very rarely but we have seen the following exception (pulled from a server
running 1.6.4).  Looking at the code I believe this condition can still happen in 1.8.0:
> java.util.concurrent.ExecutionException: java.lang.IllegalStateException: Called next()
when there is no top
> ...
> Caused by: java.lang.IllegalStateException: Called next() when there is no top
> 77)
> 96)
> SourceSwitchingIterator.readNext( 139)
> 123)
> PartialMutationSkippingIterator.consume(

This message was sent by Atlassian JIRA

View raw message