lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Muir (Commented) (JIRA)" <>
Subject [jira] [Commented] (LUCENE-3872) Index changes are lost if you call prepareCommit() then close()
Date Thu, 15 Mar 2012 17:37:37 GMT


Robert Muir commented on LUCENE-3872:

in this case IW.close would detect the missing call to commit, call commit, and call commit
again to save any changes done after the prepareCommit and before close.

I think that would make it even more lenient and complicated and worse. I guess i feel close()
should really be rollback(). But this is likely ridiculous to change.
So on second thought I think patch is good... if someone is handling exceptional cases like
this they should be thinking about using rollback() anyway,
and they have this option still.

I wasn't really against the patch anyway, just whining. its definitely an improvement on the
current behavior, let's do it.

> Index changes are lost if you call prepareCommit() then close()
> ---------------------------------------------------------------
>                 Key: LUCENE-3872
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 3.6, 4.0
>         Attachments: LUCENE-3872.patch, LUCENE-3872.patch
> You are supposed to call commit() after calling prepareCommit(), but... if you forget,
and call close() after prepareCommit() without calling commit(), then any changes done after
the prepareCommit() are silently lost (including adding/deleting docs, but also any completed
> Spinoff from java-user thread "lots of .cfs (compound files) in the index directory"
from Tim Bogaert.
> I think to fix this, IW.close should throw an IllegalStateException if prepareCommit()
was called with no matching call to commit().

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


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

View raw message