lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Busch (JIRA)" <>
Subject [jira] Commented: (LUCENE-2324) Per thread DocumentsWriters that write their own private segments
Date Mon, 29 Mar 2010 00:35:27 GMT


Michael Busch commented on LUCENE-2324:

Yes, we would need to buffer terms/queries per DW and also per DW the BufferedDeletes.Num.
 The docID spaces in two DWs will be completely independent of each other after this change.

One potential problem that we (I think) even today have is the following: If you index with
multiple threads, and then call e.g. deleteDocuments(Term) with one of the indexer threads
while you keep adding documents with the other threads, it's not clear to the caller when
exactly the deleteDocuments(Term) will happen.  It depends on the thread scheduling. 

Going back to the idea I mentioned here:

I mentioned the idea of having a sequence ID, that gets incremented on add, delete, update.
 What if we had even with separate DWs a global sequence ID?  The sequence ID would tell you
unambiguously which action happened when.  The add/update/delete methods could return the
sequenceID that was assigned to that particular action.  

Then we could e.g. track the delete terms globally together with the sequenceID of the corresponding
delete call, while we still apply deletes during flush.  Since sequenceIDs enforce a strict
ordering we can figure out to how many docs per DW we need to apply the delete terms.

Later when we switch to real-time deletes (when the RAM is searchable) we will simply store
the sequenceIDs in the deletes int[] array which I mentioned in my comment on LUCENE-2293.

Does this make sense?

> Per thread DocumentsWriters that write their own private segments
> -----------------------------------------------------------------
>                 Key: LUCENE-2324
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>            Reporter: Michael Busch
>            Assignee: Michael Busch
>            Priority: Minor
>             Fix For: 3.1
>         Attachments: LUCENE-2324.patch
> 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:
For additional commands, e-mail:

View raw message