[
https://issues.apache.org/jira/browse/LUCENE-4246?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13959884#comment-13959884
]
Michael McCandless commented on LUCENE-4246:
--------------------------------------------
Thanks Simon.
bq. In IW#shutdown should we do commit() and close in a try finally manner or
rollback if commit throws an exception?
OK I'll do that; this way, on exception, the writer is closed and you may have
lost stuff.
bq. I don't think we should use a string to message if we have uncommitted can
you use a boolean for this?
OK I'll cutover to boolean and just throw a generic "pending changes or running
merges" message, i.e. I won't distinguish the two.
bq. the pendingCommit check in IW#shutdown() is just double safety / fail early
logic right ?
Actually, this is a very important check, because otherwise you can silently
lose changes on shutdown; see LUCENE-3872. Basically, if you call
prepareCommit, then index a bunch of docs, then call shutdown, those docs will
be lost because prepareCommit took a point-in-time snapshot before you indexed
the docs, and it's that snapshot that is committed by shutdown.
bq. so IW#shutdown will wait for merges by default if you don't want this you
have to do that yourself, call abort merges, commit & close?
Yeah, I think that's better than adding a boolean to shutdown?
> 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]