lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Rutherglen (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENE-2680) Improve how IndexWriter flushes deletes against existing segments
Date Fri, 19 Nov 2010 23:59:14 GMT

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

Jason Rutherglen commented on LUCENE-2680:
------------------------------------------

I'm seeing the following error which is probably triggered by the new per-segment deletes
code, however also could be related to the recent CFS format changes?

{code}
MockDirectoryWrapper: cannot close: there are still open files: {_0.cfs=1, _1.cfs=1}
    [junit] java.lang.RuntimeException: MockDirectoryWrapper: cannot close: there are still
open files: {_0.cfs=1, _1.cfs=1}
    [junit] 	at org.apache.lucene.store.MockDirectoryWrapper.close(MockDirectoryWrapper.java:395)
    [junit] 	at org.apache.lucene.index.TestIndexReader.testReopenChangeReadonly(TestIndexReader.java:1717)
    [junit] 	at org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(LuceneTestCase.java:921)
    [junit] 	at org.apache.lucene.util.LuceneTestCase$LuceneTestCaseRunner.runChild(LuceneTestCase.java:859)
    [junit] Caused by: java.lang.RuntimeException: unclosed IndexInput
    [junit] 	at org.apache.lucene.store.MockDirectoryWrapper.openInput(MockDirectoryWrapper.java:350)
    [junit] 	at org.apache.lucene.store.Directory.openInput(Directory.java:138)
    [junit] 	at org.apache.lucene.index.CompoundFileReader.<init>(CompoundFileReader.java:67)
    [junit] 	at org.apache.lucene.index.SegmentReader$CoreReaders.<init>(SegmentReader.java:121)
    [junit] 	at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:527)
    [junit] 	at org.apache.lucene.index.IndexWriter$ReaderPool.get(IndexWriter.java:628)
    [junit] 	at org.apache.lucene.index.IndexWriter$ReaderPool.get(IndexWriter.java:603)
    [junit] 	at org.apache.lucene.index.DocumentsWriter.applyDeletes(DocumentsWriter.java:1081)
    [junit] 	at org.apache.lucene.index.IndexWriter.applyDeletesAll(IndexWriter.java:4300)
    [junit] 	at org.apache.lucene.index.IndexWriter.doFlushInternal(IndexWriter.java:3440)
    [junit] 	at org.apache.lucene.index.IndexWriter.doFlush(IndexWriter.java:3276)
    [junit] 	at org.apache.lucene.index.IndexWriter.flush(IndexWriter.java:3266)
    [junit] 	at org.apache.lucene.index.IndexWriter.prepareCommit(IndexWriter.java:3131)
    [junit] 	at org.apache.lucene.index.IndexWriter.commit(IndexWriter.java:3206)
{code}

> Improve how IndexWriter flushes deletes against existing segments
> -----------------------------------------------------------------
>
>                 Key: LUCENE-2680
>                 URL: https://issues.apache.org/jira/browse/LUCENE-2680
>             Project: Lucene - Java
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>             Fix For: 4.0
>
>         Attachments: LUCENE-2680.patch, LUCENE-2680.patch, LUCENE-2680.patch, LUCENE-2680.patch,
LUCENE-2680.patch, LUCENE-2680.patch, LUCENE-2680.patch, LUCENE-2680.patch, LUCENE-2680.patch
>
>
> IndexWriter buffers up all deletes (by Term and Query) and only
> applies them if 1) commit or NRT getReader() is called, or 2) a merge
> is about to kickoff.
> We do this because, for a large index, it's very costly to open a
> SegmentReader for every segment in the index.  So we defer as long as
> we can.  We do it just before merge so that the merge can eliminate
> the deleted docs.
> But, most merges are small, yet in a big index we apply deletes to all
> of the segments, which is really very wasteful.
> Instead, we should only apply the buffered deletes to the segments
> that are about to be merged, and keep the buffer around for the
> remaining segments.
> I think it's not so hard to do; we'd have to have generations of
> pending deletions, because the newly merged segment doesn't need the
> same buffered deletions applied again.  So every time a merge kicks
> off, we pinch off the current set of buffered deletions, open a new
> set (the next generation), and record which segment was created as of
> which generation.
> This should be a very sizable gain for large indices that mix
> deletes, though, less so in flex since opening the terms index is much
> faster.

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


Mime
View raw message