[
https://issues.apache.org/jira/browse/LUCENE-4246?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
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
commit.
And, I removed IW.closeInternal.
> Fix IndexWriter.close() to not commit or wait for pending merges
> ----------------------------------------------------------------
>
> Key: LUCENE-4246
> URL: https://issues.apache.org/jira/browse/LUCENE-4246
> 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
(v6.2#6252)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]