Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-2794

Lucene index: after.doc exceeds the number of documents in the reader

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • lucene, query
    • None

    Description

      The following exception can occur:

      java.lang.IllegalArgumentException: after.doc exceeds the number of documents in the reader: after.doc=2027462 limit=2027455
              at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:442)
              at org.apache.lucene.search.IndexSearcher.searchAfter(IndexSearcher.java:243)
              at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndex$1.loadDocs(LuceneIndex.java:352)
              at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndex$1.computeNext(LuceneIndex.java:292)
              at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndex$1.computeNext(LuceneIndex.java:283)
              at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
              at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
              at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndex$LucenePathCursor$1.hasNext(LuceneIndex.java:1062)
              at com.google.common.collect.Iterators$7.computeNext(Iterators.java:645)
              at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:143)
              at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:138)
              at org.apache.jackrabbit.oak.spi.query.Cursors$PathCursor.hasNext(Cursors.java:198)
              at org.apache.jackrabbit.oak.plugins.index.lucene.LuceneIndex$LucenePathCursor.hasNext(LuceneIndex.java:1083)
              at org.apache.jackrabbit.oak.plugins.index.aggregate.AggregationCursor.fetchNext(AggregationCursor.java:88)
              at org.apache.jackrabbit.oak.plugins.index.aggregate.AggregationCursor.hasNext(AggregationCursor.java:75)
              at org.apache.jackrabbit.oak.spi.query.Cursors$IntersectionCursor.fetchNext(Cursors.java:403)
              at org.apache.jackrabbit.oak.spi.query.Cursors$IntersectionCursor.hasNext(Cursors.java:381)
              at org.apache.jackrabbit.oak.query.ast.SelectorImpl.next(SelectorImpl.java:401)
              at org.apache.jackrabbit.oak.query.QueryImpl$RowIterator.fetchNext(QueryImpl.java:664)
              at org.apache.jackrabbit.oak.query.QueryImpl$RowIterator.hasNext(QueryImpl.java:689)
              at org.apache.jackrabbit.oak.query.FilterIterators$SortIterator.init(FilterIterators.java:203)
              at org.apache.jackrabbit.oak.query.FilterIterators$SortIterator.hasNext(FilterIterators.java:237)
              at org.apache.jackrabbit.oak.jcr.query.QueryResultImpl$1.fetch(QueryResultImpl.java:108)
              at org.apache.jackrabbit.oak.jcr.query.QueryResultImpl$1.<init>(QueryResultImpl.java:104)
              at org.apache.jackrabbit.oak.jcr.query.QueryResultImpl.getRows(QueryResultImpl.java:91)
              at org.apache.jackrabbit.commons.query.GQL.executeJcrQuery(GQL.java:440)
              at org.apache.jackrabbit.commons.query.GQL.execute(GQL.java:434)
              at org.apache.jackrabbit.commons.query.GQL.execute(GQL.java:327)
              at org.apache.jackrabbit.commons.query.GQL.execute(GQL.java:310)
              at org.apache.jackrabbit.commons.query.GQL.execute(GQL.java:296)
      

      I guess the reason is that the "lastDoc" is part of the iterator, but the "IndexSearcher" is not always the same, so that if there were changes in the meantime, the "lastDoc" does not correspond to this "IndexSearcher". This might mean the query result is sometimes wrong (matches are not returned, or returned twice).

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              thomasm Thomas Mueller
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: