[
https://issues.apache.org/jira/browse/LUCENE-2324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12979308#action_12979308
]
Michael McCandless commented on LUCENE-2324:
--------------------------------------------
{quote}
I think with B
we're saying even if the calling thread is bound to DWPT #1, if DWPT #2 is
greater in size and the aggregate RAM usage exceeds the max, using the calling
thread, we take DWPT #2 out of production, flush, and return it?
{quote}
Right -- the thread affinity has nothing to do with which thread gets to flush
which DWPT. Once flush is triggered, the thread doing the flushing is free to
flush any DWPT.
{quote}
Maybe we can simply throw out the DWPT
and put recycling byte[]s and/or pooling DWPTs back in later if it's necessary?
{quote}
OK let's start there and put back re-use only if we see a real perf issue?
bq. What I meant was the following situation: Suppose we have two DWPTs and
IW.commit() is called. The first DWPT finishes flushing successfully, is
returned to the pool and idle again. The second DWPT flush fails with an
aborting exception.
Hmm, tricky. I think I'd lean towards keeping segment 1. Discarding it would
be inconsistent w/ aborts hit during the "flushed by RAM" case? EG if seg 1
was flushed due to RAM usage, succeeds, and then later seg 2 is flushed due to
RAM usage, but aborts. In this case we would still keep seg 1?
I think aborting a flush should only lose the docs in that one DWPT (as it is
today).
Remember, a call to commit may succeed in flushing seg 1 to disk, and updating
the in-memory segment infos, but on hitting the aborting exc to seg 2, will
throw that to the caller, not having committed *any* change to the index.
Exceptions thrown during the prepareCommit (phase 1) part of commit mean
nothing is changed in the index.
Alternatively... we could abort the entire IW session (as eg we handle OOME
today) if ever an aborting exception was hit? This might be cleaner? But it's
really a "nuke the world" option which scares me. EG it could be a looong
indexing session (app doesn't call commit() until the end) and we could be
throwing away *alot* of progress.
> Per thread DocumentsWriters that write their own private segments
> -----------------------------------------------------------------
>
> Key: LUCENE-2324
> URL: https://issues.apache.org/jira/browse/LUCENE-2324
> Project: Lucene - Java
> Issue Type: Improvement
> Components: Index
> Reporter: Michael Busch
> Assignee: Michael Busch
> Priority: Minor
> Fix For: Realtime Branch
>
> Attachments: LUCENE-2324-SMALL.patch, LUCENE-2324-SMALL.patch,
> LUCENE-2324-SMALL.patch, LUCENE-2324-SMALL.patch, LUCENE-2324-SMALL.patch,
> lucene-2324.patch, lucene-2324.patch, LUCENE-2324.patch, test.out, test.out
>
>
> See LUCENE-2293 for motivation and more details.
> I'm copying here Mike's summary he posted on 2293:
> Change the approach for how we buffer in RAM to a more isolated
> approach, whereby IW has N fully independent RAM segments
> in-process and when a doc needs to be indexed it's added to one of
> them. Each segment would also write its own doc stores and
> "normal" segment merging (not the inefficient merge we now do on
> flush) would merge them. This should be a good simplification in
> the chain (eg maybe we can remove the *PerThread classes). The
> segments can flush independently, letting us make much better
> concurrent use of IO & CPU.
--
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: [email protected]
For additional commands, e-mail: [email protected]