[ 
https://issues.apache.org/jira/browse/LUCENE-5907?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Michael McCandless updated LUCENE-5907:
---------------------------------------

    Attachment: LUCENE-5907.patch

Patch with fix; I think it's ready.

The issue here was that we failed to make a fully deep clone of the
SegmentInfos that we pass to the NRT reader on init: it shared
SegmentInfo with IndexWriter's private SegmentInfos.  This then meant
that we incRef'd one set of files on opening the reader, but then
decRef'd a different set of files when closing it, causing over-decRef
of the _N.si and _N_upgraded.si files.

It's "normally" safe to not deep-clone the SI because it "normally"
doesn't change after it's created, but in this one case (upgrading a
3.x SegmentInfo on commit), it does (we call SI.addFile(..)).

The fix was to make it an option to also clone the SI instances.

However, we can't do this always (whenever SIS.clone is invoked)
because in other places where we SIS.clone we rely on the SI not being
cloned (I added a separate test case showing this).


> closing NRT reader after upgrading from 3.x index can cause index corruption
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-5907
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5907
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 5.0, 4.10
>
>         Attachments: LUCENE-5907.patch, LUCENE-5907.patch
>
>
> I have a small test case showing the issue....
> I think we should fix this for 4.10?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to