lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simon Willnauer (JIRA)" <>
Subject [jira] Commented: (LUCENE-2802) DirectoryReader ignores NRT SegmentInfos in #isOptimized()
Date Mon, 06 Dec 2010 15:43:11 GMT


Simon Willnauer commented on LUCENE-2802:

bq. Nice catch Simon! This is also a thread safety issue since IR should not touch the writer's
segmentInfos outside of sync(IW).
it seem like there is more about all that in DR - we should really only use the uncloned SegmentInfos
if we are not in NRT mode #getVersion uses it too which is wrong.
I actually rely on the isOptimized in several tests and run into a NPE due to that though
so we should really fix DR to use a private SegmentInfos or restrict the uncloned one for
the isCurrent comparison

> DirectoryReader ignores NRT SegmentInfos in #isOptimized()
> ----------------------------------------------------------
>                 Key: LUCENE-2802
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Bug
>          Components: Search
>    Affects Versions: 4.0
>            Reporter: Simon Willnauer
>         Attachments: LUCENE-2802.patch
> DirectoryReader  only takes shared (with IW) SegmentInfos into account in DirectoryReader#isOptimized().
This can return true even if the actual realtime reader sees more than one segments. 
> {code}
> public boolean isOptimized() {
>     ensureOpen();
>    // if segmentsInfos changes in IW this can return false positive
>     return segmentInfos.size() == 1 && !hasDeletions();
>   }
> {code}
> DirectoryReader should check if this reader has a non-nul segmentInfosStart and use that

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:
For additional commands, e-mail:

View raw message