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

Michael McCandless updated LUCENE-6616:
---------------------------------------
    Attachment: LUCENE-6616.patch

New patch, it's closer I think.  Tests passed once, but I still have one 
nocommit ...

I made some drastic changes to IndexFileDeleter (thanks to [~rcmuir] for this 
idea!).  All places that used to directly delete a file now instead make three 
passes:

  * First just gather up all files wanting to be deleted, adding them to the 
deletable HashSet.

  * Second, try to delete all the segments_N files in that set.

  * Finally, delete all non-segments files, only if 2nd pass succeeded.

This ensures that even in the presence of a virus checker, the index is never 
left in a state where a segments_N is referencing a non-existent file.

I also fixed all file deletion done by IW to use IFD's methods, and made 
IFD.deleteFile private.


> IndexWriter should list files once on init, and IFD should not suppress FNFE
> ----------------------------------------------------------------------------
>
>                 Key: LUCENE-6616
>                 URL: https://issues.apache.org/jira/browse/LUCENE-6616
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Michael McCandless
>            Assignee: Michael McCandless
>             Fix For: 5.3, Trunk
>
>         Attachments: LUCENE-6616.patch, LUCENE-6616.patch
>
>
> Some nice ideas [~rcmuir] had for cleaning up IW/IFD on init ...



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to