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

Erick Erickson commented on SOLR-11892:
---------------------------------------

I've been digging into this a little more and here's what I'm seeing: The large 
majority of these are coming from these lines in 
NRTCachingDirectory.createOutput:

{{try {}}
{{  in.deleteFile(name);}}
{{ } catch (IOException ioe) {}}
{{  // This is fine: file may not exist}}
{{ }}}

The naive question is "why wouldn't just opening the file for overwrite work?" 
My _guess_ is there's too many edge cases when it comes to different filesystem 
semantics (e.g. Windows and Unix), plus RAMDirectory issues. Or left over files 
if someone pulled the plug on the machine with segments created that weren't 
written yet to the segments_n file. Or......

For yucks I tried using NIOFSDirectory and it caused almost all of these 
exceptions to disappear, as did MMapDirectory. Does that make sense from your 
perspectives?

So I guess it comes down to whether the logic of deleting the files in 
NRTCachingDirectory is necessary, there's no explanation in the code for what 
this guards against and I'm not familiar enough with all the concerns to know 
off the top of my head. All education welcome....

> Avoid unnecessary exceptions in FSDirectory and RAMDirectory
> ------------------------------------------------------------
>
>                 Key: SOLR-11892
>                 URL: https://issues.apache.org/jira/browse/SOLR-11892
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>            Reporter: Erick Erickson
>            Assignee: Erick Erickson
>            Priority: Minor
>         Attachments: Screen Shot 2018-01-24 at 9.09.55 PM.png, Screen Shot 
> 2018-01-24 at 9.10.47 PM.png
>
>
> In privateDeleteFile, just use deleteIfExists.
> in RamDirectory we can declare a static exception and create it once.
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to