You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Shawn Heisey (JIRA)" <ji...@apache.org> on 2012/06/07 20:42:23 UTC

[jira] [Commented] (SOLR-1691) Deal with deleting old index files in Windows auto-magicly

    [ https://issues.apache.org/jira/browse/SOLR-1691?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13291196#comment-13291196 ] 

Shawn Heisey commented on SOLR-1691:
------------------------------------

I'll warn in advance that this may be completely impractical.  Feel free to dismiss it completely if it's just not workable.

Would it be possible to delegate the removal of old index files to the IndexReader that has them open?  Here's my idea:  Add a close(boolean) method to IndexReader.  If the boolean is true, it would delete any files not currently in use by any other IR.  To make that possible, the IR class would need to have a static member keeping track of all open IR instances.  Each IR would likely know what files it requires.  This new close method could ask each of the other IR instances whether it needed each file.  If a file is not needed, the new close method would delete it.

Javadocs say that write support will be removed from IndexReader in 4.0, and this would violate a strict interpretation.  It may be a bad idea for other reasons that are not apparent to my poor grasp of Lucene internals.  I have no idea how the close() method is currently called when a commit is required, so I can't say whether this is even possible.

If there are multiple java processes involved, this wouldn't work at all.  In a typical Solr install, I don't think there would be multiple processes, but for other Lucene applications, it may be likely.

                
> Deal with deleting old index files in Windows auto-magicly
> ----------------------------------------------------------
>
>                 Key: SOLR-1691
>                 URL: https://issues.apache.org/jira/browse/SOLR-1691
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Hoss Man
>
> Windows users are frequently confused/frustrated by the size of an index after making lots of changes/commits because of the way Windows prevents files with open handles from being deleted.
> In Lucene-Java, IndexWriter will attempt to delete any old files whenever it can, but only on a subsequent change -- we should see if we could add something to Solr to try and be more proactive about this...
> http://old.nabble.com/Delete%2C-commit%2C-optimize-doesn%27t-reduce-index-file-size-to26958067.html

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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