You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Michael McCandless (JIRA)" <ji...@apache.org> on 2007/05/31 21:22:15 UTC

[jira] Commented: (LUCENE-887) Interruptible segment merges

    [ https://issues.apache.org/jira/browse/LUCENE-887?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12500457 ] 

Michael McCandless commented on LUCENE-887:
-------------------------------------------


This looks great to me!

I think we should keep it out of core (ie, as subclasses as you've done
here) for now?

So, if a shutdown request comes in then currently running addDocument
calls are allowed to complete but if a new addDocument call tries to
run it will hit an "IndexWriter already closed" IOException.  Once the
in-flight addDocument calls finish you then flush the ram segments
without allowing cascading merge.

This actually means you can potentially have too many "level 0" (just
flushed) segments in the index but that should not be a big deal since
the next merge would clean it up.  And it should be rare.

In shutdown(), after you call waitForAddDocument(), why not call
clearInterrupt before calling flushRamSegments?  Isn't the
flushRamSegments() call guaranteed to hit the
IndexWriterInterruptException if it's using an ExtendedFSDirectory and
there are > 0 buffered docs?

Also I think it's possible that the addDocument() call from another
thread will hit the IndexWriterInterruptException, right?  So those
other threads should catch this and ignore it (since their doc was in
fact succesfully added and only the followon merge was interrupted)?


> Interruptible segment merges
> ----------------------------
>
>                 Key: LUCENE-887
>                 URL: https://issues.apache.org/jira/browse/LUCENE-887
>             Project: Lucene - Java
>          Issue Type: New Feature
>          Components: Index
>            Reporter: Michael Busch
>            Priority: Minor
>             Fix For: 2.2
>
>         Attachments: ExtendedIndexWriter.java
>
>
> Adds the ability to IndexWriter to interrupt an ongoing merge. This might be necessary when Lucene is e. g. running as a service and has to stop indexing within a certain period of time due to a shutdown request.
> A solution would be to add a new method shutdown() to IndexWriter which satisfies the following two requirements:
> - if a merge is happening, abort it
> - flush the buffered docs but do not trigger a merge 
> See also discussions about this feature on java-dev:
> http://www.gossamer-threads.com/lists/lucene/java-dev/49008

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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