lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "KuroSaka TeruHiko (JIRA)" <>
Subject [jira] [Updated] (LUCENE-2645) False assertion of >0 position delta in StandardPostingsWriterImpl
Date Fri, 03 Jun 2011 21:51:47 GMT


KuroSaka TeruHiko updated LUCENE-2645:


This is preventing one of unit tests for our Tokenizer/Filter product to fail.  Although it
looks as though the unit test is failing, actually it is an assertion error from this assertion.
We have analyzed the Token sequence that causes this assertion to fail, but they look valid.
The attached program can reproduce this false assertion failure. Please give it higher priority
and remove this assertion.
$ javac -cp lucene-core-4.0-SNAPSHOT.jar
$ java -ea -cp .:lucene-core-4.0-SNAPSHOT.jar LuceneTrunkAssertErrorReproducer
Exception in thread "main" java.lang.AssertionError: position=1 lastPosition=1
	at org.apache.lucene.index.codecs.standard.StandardPostingsWriter.addPosition(
	at org.apache.lucene.index.FreqProxTermsWriterPerField.flush(
	at org.apache.lucene.index.FreqProxTermsWriter.flush(
	at org.apache.lucene.index.TermsHash.flush(
	at org.apache.lucene.index.DocInverter.flush(
	at org.apache.lucene.index.DocFieldProcessor.flush(
	at org.apache.lucene.index.DocumentsWriterPerThread.flush(
	at org.apache.lucene.index.DocumentsWriter.doFlush(
	at org.apache.lucene.index.DocumentsWriter.flushAllThreads(
	at org.apache.lucene.index.IndexWriter.doFlush(
	at org.apache.lucene.index.IndexWriter.flush(
	at org.apache.lucene.index.IndexWriter.prepareCommit(
	at org.apache.lucene.index.IndexWriter.commitInternal(
	at org.apache.lucene.index.IndexWriter.commit(
	at org.apache.lucene.index.IndexWriter.commit(
	at LuceneTrunkAssertErrorReproducer.main(

> False assertion of >0 position delta in StandardPostingsWriterImpl
> ------------------------------------------------------------------
>                 Key: LUCENE-2645
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: core/index
>            Reporter: David Smiley
>            Priority: Minor
>         Attachments:
> StandardPostingsWriterImpl line 159 is:
> {code:java}
>     assert delta > 0 || position == 0 || position == -1: "position=" + position +
" lastPosition=" + lastPosition;            // not quite right (if pos=0 is repeated twice
we don't catch it)
> {code}
> I enable assertions when I run my unit tests and I've found this assertion to fail when
delta is 0 which occurs when the same position value is sent in twice in arrow.  Once I added
RemoveDuplicatesTokenFilter, this problem went away.  Should I really be forced to add this
filter?  I think delta >= 0 would be a better assertion.

This message is automatically generated by JIRA.
For more information on JIRA, see:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message