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

Shai Erera commented on LUCENE-1076:
------------------------------------

Hmm ... I think I found the problem. I added commit() after cms.sync() and it 
never failed again. So I checked the output of infoStream in two cases (failure 
and success) and found this: in the success case, the pending merges occurred 
before the last addDocument calls happened (actually the last 2), therefore 
commit() committed those pending merges output, and sync() afterwards did 
nothing.

In the failure case, the last pending merge happened *after* commit() was 
called, either as (or not) part of the sync() call, but it was never committed.

So it looks to me that I should add this test case as 
testOptimizeMaxNumSegments3() (even though it has nothing to do w/ optimize()), 
just to cover this aspect and also document CMS.sync() to mention that a 
commit() after it is required if the outcome of the merges should be reflected 
in the index (i.e., committed).

Did I get it right?

> Allow MergePolicy to select non-contiguous merges
> -------------------------------------------------
>
>                 Key: LUCENE-1076
>                 URL: https://issues.apache.org/jira/browse/LUCENE-1076
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Index
>    Affects Versions: 2.3
>            Reporter: Michael McCandless
>            Priority: Minor
>         Attachments: LUCENE-1076.patch
>
>
> I started work on this but with LUCENE-1044 I won't make much progress
> on it for a while, so I want to checkpoint my current state/patch.
> For backwards compatibility we must leave the default MergePolicy as
> selecting contiguous merges.  This is necessary because some
> applications rely on "temporal monotonicity" of doc IDs, which means
> even though merges can re-number documents, the renumbering will
> always reflect the order in which the documents were added to the
> index.
> Still, for those apps that do not rely on this, we should offer a
> MergePolicy that is free to select the best merges regardless of
> whether they are continuguous.  This requires fixing IndexWriter to
> accept such a merge, and, fixing LogMergePolicy to optionally allow
> it the freedom to do so.

-- 
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