Hi,

I said "possible bug" - and because of this I wanted to start a discussion. In 
fact, I am fine with this change if it is documented that creating a 
FSDirectory instance implicitely creates the directory - otherwise we are 
breaking https://issues.apache.org/jira/browse/LUCENE-1464 again.

To me I am not happy with this change, because it's wrong to me, if you just 
open an IndexReader (e.g., on a read-only filesystem) and it will try to create 
the directory. Can we be sure that this will not break if FileSystem is 
read-only (like CD-ROM). I have no idea what happens if you call 
Files.createDirectories() on a read-only file system if all directory 
components already exist (it should be a no-op, but who knows).

I was already thinking about optionally allow to open FSDirectory only for 
read, so it will fails early if dir does not already exist (openOutput would of 
course also fail, but that’s just on top of that). I have not yet a strong 
opinion.

So at least, please document this in FSDirectory and its subclasses that a call 
to open() or calling a ctor actually creates the directory!

Uwe

-----
Uwe Schindler
H.-H.-Meier-Allee 63, D-28213 Bremen
http://www.thetaphi.de
eMail: [email protected]

> -----Original Message-----
> From: Robert Muir [mailto:[email protected]]
> Sent: Wednesday, February 04, 2015 1:44 PM
> To: [email protected]
> Cc: [email protected]
> Subject: Re: FSDirectory and creating directory
> 
> On Wed, Feb 4, 2015 at 4:03 AM, Uwe Schindler <[email protected]>
> wrote:
> 
> > The question is now: Do we really intend to create the directory in Lucene 5
> ? What about opening an IndexReader on a non-existent directory on a read-
> only filesystem? I know that Robert added this to make path.getRealPath()
> to work correctly?
> >
> > I just want to discuss this before we release 5.0. To me it sounds wrong to
> create the directory in the constructor...
> >
> 
> Please dont call this a bug until you understand why the change was made.
> Please, read the behavior of getCanonicalPath and understand exactly why
> and how it fails: and its this nonexistent case.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected] For additional
> commands, e-mail: [email protected]


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

Reply via email to