You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Alexander Gutkin (JIRA)" <ji...@apache.org> on 2006/03/25 23:27:18 UTC
[jira] Created: (LUCENE-531) RAMDirectory creation from existing
FSDirectory throws IOException ("is a directory")
RAMDirectory creation from existing FSDirectory throws IOException ("is a directory")
-------------------------------------------------------------------------------------
Key: LUCENE-531
URL: http://issues.apache.org/jira/browse/LUCENE-531
Project: Lucene - Java
Type: Bug
Components: Store
Versions: 1.9, 2.0
Environment: OS: Fedora 5
2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 athlon i386 GNU/Linux
java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
Reporter: Alexander Gutkin
Priority: Minor
If you generate an index somewhere on the filesystem in location DIR and later on
add some other (not index-related) directories to DIR, then loading that index using
FSDirectory will succeed. However, if you then attempt to load that index into
RAM using RAMDirectory API, RAMDirectory constructor will throw an exception
because it assumes that FSDirectory will return a list of files residing in DIR. The
problem with the trunk is that FSDirectory.list() implementation does not check
for extraneous entities in the index directory, hence breaking RAMDirectory
construction.
I encountered this issue because I started storing some of my tiny indexes under
version control. Loading these indexes using RAMDirectory fails because of
the CVS/subversion directories (.svn/.cvs) which are created within the index
directories.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
Re: [jira] Commented: (LUCENE-531) RAMDirectory creation from existing FSDirectory throws IOException ("is a directory")
Posted by Simon Willnauer <si...@googlemail.com>.
Yes It is, I did not extend the testcase for this issue but I could do
if it is really requiered. The fix was quiet trivial.
best regards simon
On 9/23/06, Nicolas Lalevée (JIRA) <ji...@apache.org> wrote:
> [ http://issues.apache.org/jira/browse/LUCENE-531?page=comments#action_12437128 ]
>
> Nicolas Lalevée commented on LUCENE-531:
> ----------------------------------------
>
> I think this is fixed with LUCENE-638
>
> > RAMDirectory creation from existing FSDirectory throws IOException ("is a directory")
> > -------------------------------------------------------------------------------------
> >
> > Key: LUCENE-531
> > URL: http://issues.apache.org/jira/browse/LUCENE-531
> > Project: Lucene - Java
> > Issue Type: Bug
> > Components: Store
> > Affects Versions: 1.9, 2.0.0
> > Environment: OS: Fedora 5
> > 2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 athlon i386 GNU/Linux
> > java version "1.5.0_06"
> > Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> > Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
> > Reporter: Alexander Gutkin
> > Priority: Minor
> > Attachments: patch.txt, patch_1.9-branch.txt
> >
> >
> > If you generate an index somewhere on the filesystem in location DIR and later on
> > add some other (not index-related) directories to DIR, then loading that index using
> > FSDirectory will succeed. However, if you then attempt to load that index into
> > RAM using RAMDirectory API, RAMDirectory constructor will throw an exception
> > because it assumes that FSDirectory will return a list of files residing in DIR. The
> > problem with the trunk is that FSDirectory.list() implementation does not check
> > for extraneous entities in the index directory, hence breaking RAMDirectory
> > construction.
> > I encountered this issue because I started storing some of my tiny indexes under
> > version control. Loading these indexes using RAMDirectory fails because of
> > the CVS/subversion directories (.svn/.cvs) which are created within the index
> > directories.
>
> --
> This message is automatically generated by JIRA.
> -
> If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: java-dev-help@lucene.apache.org
>
>
[jira] Commented: (LUCENE-531) RAMDirectory creation from existing
FSDirectory throws IOException ("is a directory")
Posted by "Alexander Gutkin (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LUCENE-531?page=comments#action_12371894 ]
Alexander Gutkin commented on LUCENE-531:
-----------------------------------------
BTW, the bug was discovered with Lucene 1.9.1
> RAMDirectory creation from existing FSDirectory throws IOException ("is a directory")
> -------------------------------------------------------------------------------------
>
> Key: LUCENE-531
> URL: http://issues.apache.org/jira/browse/LUCENE-531
> Project: Lucene - Java
> Type: Bug
> Components: Store
> Versions: 1.9, 2.0
> Environment: OS: Fedora 5
> 2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 athlon i386 GNU/Linux
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
> Reporter: Alexander Gutkin
> Priority: Minor
> Attachments: patch.txt, patch_1.9-branch.txt
>
> If you generate an index somewhere on the filesystem in location DIR and later on
> add some other (not index-related) directories to DIR, then loading that index using
> FSDirectory will succeed. However, if you then attempt to load that index into
> RAM using RAMDirectory API, RAMDirectory constructor will throw an exception
> because it assumes that FSDirectory will return a list of files residing in DIR. The
> problem with the trunk is that FSDirectory.list() implementation does not check
> for extraneous entities in the index directory, hence breaking RAMDirectory
> construction.
> I encountered this issue because I started storing some of my tiny indexes under
> version control. Loading these indexes using RAMDirectory fails because of
> the CVS/subversion directories (.svn/.cvs) which are created within the index
> directories.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
[jira] Resolved: (LUCENE-531) RAMDirectory creation from existing
FSDirectory throws IOException ("is a directory")
Posted by "Otis Gospodnetic (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LUCENE-531?page=all ]
Otis Gospodnetic resolved LUCENE-531.
-------------------------------------
Resolution: Duplicate
Indeed, LUCENE-638 seems to contain the fix for this, good catch.
> RAMDirectory creation from existing FSDirectory throws IOException ("is a directory")
> -------------------------------------------------------------------------------------
>
> Key: LUCENE-531
> URL: http://issues.apache.org/jira/browse/LUCENE-531
> Project: Lucene - Java
> Issue Type: Bug
> Components: Store
> Affects Versions: 1.9, 2.0.0
> Environment: OS: Fedora 5
> 2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 athlon i386 GNU/Linux
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
> Reporter: Alexander Gutkin
> Priority: Minor
> Attachments: patch.txt, patch_1.9-branch.txt
>
>
> If you generate an index somewhere on the filesystem in location DIR and later on
> add some other (not index-related) directories to DIR, then loading that index using
> FSDirectory will succeed. However, if you then attempt to load that index into
> RAM using RAMDirectory API, RAMDirectory constructor will throw an exception
> because it assumes that FSDirectory will return a list of files residing in DIR. The
> problem with the trunk is that FSDirectory.list() implementation does not check
> for extraneous entities in the index directory, hence breaking RAMDirectory
> construction.
> I encountered this issue because I started storing some of my tiny indexes under
> version control. Loading these indexes using RAMDirectory fails because of
> the CVS/subversion directories (.svn/.cvs) which are created within the index
> directories.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
[jira] Commented: (LUCENE-531) RAMDirectory creation from existing
FSDirectory throws IOException ("is a directory")
Posted by "Nicolas Lalevée (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LUCENE-531?page=comments#action_12437128 ]
Nicolas Lalevée commented on LUCENE-531:
----------------------------------------
I think this is fixed with LUCENE-638
> RAMDirectory creation from existing FSDirectory throws IOException ("is a directory")
> -------------------------------------------------------------------------------------
>
> Key: LUCENE-531
> URL: http://issues.apache.org/jira/browse/LUCENE-531
> Project: Lucene - Java
> Issue Type: Bug
> Components: Store
> Affects Versions: 1.9, 2.0.0
> Environment: OS: Fedora 5
> 2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 athlon i386 GNU/Linux
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
> Reporter: Alexander Gutkin
> Priority: Minor
> Attachments: patch.txt, patch_1.9-branch.txt
>
>
> If you generate an index somewhere on the filesystem in location DIR and later on
> add some other (not index-related) directories to DIR, then loading that index using
> FSDirectory will succeed. However, if you then attempt to load that index into
> RAM using RAMDirectory API, RAMDirectory constructor will throw an exception
> because it assumes that FSDirectory will return a list of files residing in DIR. The
> problem with the trunk is that FSDirectory.list() implementation does not check
> for extraneous entities in the index directory, hence breaking RAMDirectory
> construction.
> I encountered this issue because I started storing some of my tiny indexes under
> version control. Loading these indexes using RAMDirectory fails because of
> the CVS/subversion directories (.svn/.cvs) which are created within the index
> directories.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
[jira] Updated: (LUCENE-531) RAMDirectory creation from existing
FSDirectory throws IOException ("is a directory")
Posted by "Alexander Gutkin (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LUCENE-531?page=all ]
Alexander Gutkin updated LUCENE-531:
------------------------------------
Attachment: patch.txt
I am attaching a trivial patch (generated against the current Lucene trunk). The patch includes
the following:
(1) Safer implementation of FSDirectory.list()
(2) A test case in org/apache/lucene/index/store/TestRAMDirectory.java
Current trunk build and tests pass successfully using this patch. Note that the patch is still
not very satisfactory because, in theory, it would be nice if FSDirectory returned only the
valid Lucene index files.
> RAMDirectory creation from existing FSDirectory throws IOException ("is a directory")
> -------------------------------------------------------------------------------------
>
> Key: LUCENE-531
> URL: http://issues.apache.org/jira/browse/LUCENE-531
> Project: Lucene - Java
> Type: Bug
> Components: Store
> Versions: 1.9, 2.0
> Environment: OS: Fedora 5
> 2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 athlon i386 GNU/Linux
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
> Reporter: Alexander Gutkin
> Priority: Minor
> Attachments: patch.txt
>
> If you generate an index somewhere on the filesystem in location DIR and later on
> add some other (not index-related) directories to DIR, then loading that index using
> FSDirectory will succeed. However, if you then attempt to load that index into
> RAM using RAMDirectory API, RAMDirectory constructor will throw an exception
> because it assumes that FSDirectory will return a list of files residing in DIR. The
> problem with the trunk is that FSDirectory.list() implementation does not check
> for extraneous entities in the index directory, hence breaking RAMDirectory
> construction.
> I encountered this issue because I started storing some of my tiny indexes under
> version control. Loading these indexes using RAMDirectory fails because of
> the CVS/subversion directories (.svn/.cvs) which are created within the index
> directories.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org
[jira] Updated: (LUCENE-531) RAMDirectory creation from existing
FSDirectory throws IOException ("is a directory")
Posted by "Alexander Gutkin (JIRA)" <ji...@apache.org>.
[ http://issues.apache.org/jira/browse/LUCENE-531?page=all ]
Alexander Gutkin updated LUCENE-531:
------------------------------------
Attachment: patch_1.9-branch.txt
I am also attaching a patch against the 1.9 branch (build and tests passed).
> RAMDirectory creation from existing FSDirectory throws IOException ("is a directory")
> -------------------------------------------------------------------------------------
>
> Key: LUCENE-531
> URL: http://issues.apache.org/jira/browse/LUCENE-531
> Project: Lucene - Java
> Type: Bug
> Components: Store
> Versions: 1.9, 2.0
> Environment: OS: Fedora 5
> 2.6.15-1.2054_FC5 #1 Tue Mar 14 15:48:33 EST 2006 i686 athlon i386 GNU/Linux
> java version "1.5.0_06"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-b05)
> Java HotSpot(TM) Client VM (build 1.5.0_06-b05, mixed mode, sharing)
> Reporter: Alexander Gutkin
> Priority: Minor
> Attachments: patch.txt, patch_1.9-branch.txt
>
> If you generate an index somewhere on the filesystem in location DIR and later on
> add some other (not index-related) directories to DIR, then loading that index using
> FSDirectory will succeed. However, if you then attempt to load that index into
> RAM using RAMDirectory API, RAMDirectory constructor will throw an exception
> because it assumes that FSDirectory will return a list of files residing in DIR. The
> problem with the trunk is that FSDirectory.list() implementation does not check
> for extraneous entities in the index directory, hence breaking RAMDirectory
> construction.
> I encountered this issue because I started storing some of my tiny indexes under
> version control. Loading these indexes using RAMDirectory fails because of
> the CVS/subversion directories (.svn/.cvs) which are created within the index
> directories.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-dev-help@lucene.apache.org