lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] [Updated] (LUCENE-4246) Fix IndexWriter.close() to not commit or wait for pending merges
Date Thu, 03 Apr 2014 23:03:15 GMT


Michael McCandless updated LUCENE-4246:

    Attachment: LUCENE-4246.patch

Here's a patch with hopefully a workable compromise:

  * IW.close now just calls rollback, with the one difference that if
    1) there were uncommitted changes or still-running merges, and 2)
    IWC's matchVersion is < 5.0, it throws an exception saying so,
    *after* the close has finished; else, the changes are silently
    dropped.  So the IW is closed, but you'll hit an exc explaining
    that you lost stuff... I think this will notify apps that are
    upgrading from 4.x that IW.close() semantics have changed.

  * I added IW.shutdown sugar method, which just flushes, finishes
    merges, commits, closes.

I also found & fixed & added a test case for a pre-existing issue,
where DocumentsWriter.numDocsInRAM could become negative, causing
IW.hasUncommittedChanges to forever return true even right after you

And, I removed IW.closeInternal.

> Fix IndexWriter.close() to not commit or wait for pending merges
> ----------------------------------------------------------------
>                 Key: LUCENE-4246
>                 URL:
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Robert Muir
>            Assignee: Michael McCandless
>             Fix For: 4.8
>         Attachments: LUCENE-4246.patch

This message was sent by Atlassian JIRA

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

View raw message