lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Busch (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-887) Interruptible segment merges
Date Thu, 22 Nov 2007 17:46:43 GMT

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

Michael Busch commented on LUCENE-887:
--------------------------------------

{quote}
I believe close(false) marks all still-running merges as aborted
(calls OneMerge.abort()) and then returns immediately without waiting
for them to finish?
{quote}
OK I got it. So if Lucene runs as a service and a shutdown request is
received, then a call to close(false) will cause the IndexWriter to mark
the running merges as aborted, flush the buffer and return once 
flush+commit is done. Then the caller knows that it is safe now to
shutdown the JVM, which will also stop the running merge thread
(because it's a daemon thread now). 
We should probably add a testcase that tests such a shutdown 
scenario.

 {quote}
If we could somehow reach in & find all FSIndexOutputs that are
presently opened by SegmentMerger, and forcefully close them (forcing
an IOException which ConcurrentMergeScheduler catches & ignores if the
merge was aborted) that'd give us a fast way to have the threads stop
working.
{quote}
The fact that the background merge thread keeps running doesn't hurt
us, but the advantage would be to reduce system load and thus to
possibly speedup the flush+commit that the other thread is doing.
Maybe for now we could also set the priority of the background thread
to a minimum value, as soon as close(false) is called?

{quote}
Oh, one issue is we are failing to setDaemon(true) on these threads,
which means the JVM will not exit until they complete. I'll fix
that.
{quote}
Cool, thanks! W/o this the above explained shutdown scenario wouldn't
work.

> 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
>            Assignee: Michael Busch
>            Priority: Minor
>         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


Mime
View raw message