lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <>
Subject [jira] [Commented] (LUCENE-4080) SegmentReader.numDeletedDocs() sometimes gives an incorrect numDeletedDocs
Date Tue, 03 Jul 2012 23:30:34 GMT


Michael McCandless commented on LUCENE-4080:

New patch looks great!  I like this solution: much simpler.  Maybe just add a comment explaining
why we must sometimes make a new reader?  (Ie, that deletes could have snuck in after we pulled
the merge reader but before the sync block where we get the live docs)?

It's nice to simply pass around the reader and not the pair of liveDocs + reader...

We can remove liveDocs and delCount args to SegmentMerger.add now?

+1, thanks Adrien!
> SegmentReader.numDeletedDocs() sometimes gives an incorrect numDeletedDocs
> --------------------------------------------------------------------------
>                 Key: LUCENE-4080
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: core/index
>    Affects Versions: 4.0, 4.1
>            Reporter: Adrien Grand
>            Priority: Trivial
>             Fix For: 4.1
>         Attachments: LUCENE-4080.patch, LUCENE-4080.patch, LUCENE-4080.patch
> At merge time, SegmentReader sometimes gives an incorrect value for numDeletedDocs.
> From LUCENE-2357:
> bq. As far as I know, [SegmenterReader.numDeletedDocs() is] only unreliable in this context
(SegmentReader passed to SegmentMerger for merging); this is because we allow newly marked
deleted docs to happen concurrently up until the moment we need to pass the SR instance to
the merger (search for "// Must sync to ensure BufferedDeletesStream" in
... but it would be nice to fix that, so I think open a new issue (it won't block this one)?
We should be able to make a new SR instance, sharing the same core as the current one but
using the correct delCount...
> bq. It would be cleaner (but I think hairier) to create a new SR for merging that holds
the correct delCount, but let's do that under the separate issue.
> bq.  it would be best if the SegmentReader's numDeletedDocs were always correct, but,
fixing that in IndexWriter is somewhat tricky. Ie, the fix could be hairy but the end result
("SegmentReader.numDeletedDocs can always be trusted") would be cleaner...

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message