lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Miller (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-6002) Fix a couple of ugly issues around SolrIndexWriter close and rollback as well as how SolrIndexWriter manages it's ref counted directory instance.
Date Wed, 23 Apr 2014 00:36:15 GMT

    [ https://issues.apache.org/jira/browse/SOLR-6002?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13977662#comment-13977662
] 

Mark Miller commented on SOLR-6002:
-----------------------------------

Thanks for the review!

bq. 1) I don't understand the need for the CLOSE_LOCK, can you explain?

Just so that only one thread will actually do the close logic. You can close an IndexWriter
with either rollback or close and one of those might internally call the other - so the CLOSE_LOCK
just makes sure the SolrIndexWriter close logic happens once. We don't use the this lock just
so that we don't end up conflicting with other uses.

bq. 2) In DirectUpdateHandler2 why the change from writer.shutdown() to writer.close()? All
the other changes go in the other direction, e.g. close -> shutdown.

Because shutdown will wait for merges and commit, etc and DirectUpdateHandler2 actually does
that right above - optionally - it was actually a small bug that someone changed it to shutdown
(that's just on branch 5x though). We didn't want to commit in all cases like shutdown was
doing. 

I do see a problem though - we need to call waitForMerges before we close.

> Fix a couple of ugly issues around SolrIndexWriter close and rollback as well as how
SolrIndexWriter manages it's ref counted directory instance.
> -------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: SOLR-6002
>                 URL: https://issues.apache.org/jira/browse/SOLR-6002
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Mark Miller
>            Assignee: Mark Miller
>            Priority: Critical
>             Fix For: 4.9, 5.0
>
>         Attachments: SOLR-6002.patch, SOLR-6002.patch, SOLR-6002.patch
>
>
> We tried jumping all kinds of hoops (unsuccessfully anyway) to *really* *really* close
an IndexWriter in the past, but Lucene wouldn't let you. Now that is fixed in Lucene and we
should update our close/rollback code.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message