[ 
https://issues.apache.org/jira/browse/LUCENE-2324?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12850760#action_12850760
 ] 

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:
https://issues.apache.org/jira/browse/LUCENE-2293?focusedCommentId=12841407&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_12841407

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: 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: 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: java-dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: java-dev-h...@lucene.apache.org

Reply via email to