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

Michael McCandless commented on LUCENE-2618:
--------------------------------------------

bq. We should fix the code to throw the exception immediately. Is there a way 
to check a Directory if it's old or not?

I agree -- IW.open should fail immediately if any of the segments are too old.

Unfortunately, I don't see a simple way to do this.  We can't just look at the 
version of the segments_N file, for example, because one segment could be from 
2.9, and [say] 3.1 had last opened the index and written the 3.x file format 
for segments_N.  See, IW does not go and open all SegmentReaders on open.  It's 
only on merge, applying deletes, or opening an NRT reader, that we go and open 
segments for reading.

I think to do this correctly we should modify segments_N format to record the 
oldest segment in the index?  Then IW can check this easily on open.

bq. I don't mind if you continue w/ the fix to the test as you did, but IMO it 
just hides the real problem. I.e., allowing all merges caused by optimize() to 
finish is a correct fix. 

I agree.

There is already a pre-existing TODO in the test stating that we should fix IW 
to throw this exc on open.  I'll also add a TODO to IW's ctor and go open an 
issue...

> Intermittent failure in 3.x's backwards TestThreadedOptimize
> ------------------------------------------------------------
>
>                 Key: LUCENE-2618
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2618
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Index
>            Reporter: Michael McCandless
>             Fix For: 3.1, 4.0
>
>         Attachments: LUCENE-2618.patch, LUCENE-2618.patch
>
>
> Failure looks like this:
> {noformat}
>     [junit] Testsuite: org.apache.lucene.index.TestThreadedOptimize
>     [junit] Testcase: 
> testThreadedOptimize(org.apache.lucene.index.TestThreadedOptimize):     FAILED
>     [junit] null
>     [junit] junit.framework.AssertionFailedError: null
>     [junit]   at 
> org.apache.lucene.index.TestThreadedOptimize.runTest(TestThreadedOptimize.java:125)
>     [junit]   at 
> org.apache.lucene.index.TestThreadedOptimize.testThreadedOptimize(TestThreadedOptimize.java:149)
>     [junit]   at 
> org.apache.lucene.util.LuceneTestCase.runBare(LuceneTestCase.java:253)
> {noformat}
> I just committed some verbosity so next time it strikes we'll have more 
> details.

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

Reply via email to