This won't work with multiple JVMs attached to the same Lucene
directory.
All JVMs need to vote as whether or not certain segments can be
deleted, since the others JVMS can't know this. How you do this...
On Jan 18, 2007, at 3:58 PM, Chuck Williams wrote:
How about a direct solution with a reference count scheme?
Segments files could be reference-counted, as well as individual
segments either directly, possibly by interning SegmentInfo instances,
or indirectly by reference counting all files via Directory.
The most recent checkpoint and snapshot would have an implicit
reference
since they can be opened. Each reader and writer creates a reference
when it opens a segments file.
This way segments files and each segment's files would be deleted
precisely when they are no longer used, which would both support
NFS and
improve performance on Windows.
Chuck
Marvin Humphrey wrote on 01/18/2007 11:40 AM:
I wrote:
I'd be cool with making it impossible to put an index on an NFS
volume prior to version 4.
Elaborating and clarifying...
IndexReader attempts to establish a read lock on the relevant
segments_N file. It doesn't bother to see whether the locking
attempt
succeeds, though.
IndexFileDeleter, before deleting any files, always touches a test
file, attempts to lock it, and verifies that the lock succeeds. If
the locking test fails, it throws an exception rather than proceed.
In addition, the locking test is run at index creation time, so that
the user knows as soon as possible that their index is in a
problematic location.
I think the only way this would fail under NFS is if the client
machine with the reader is using NFS version 3, while the machine
with
the writer is using version 4. But before this issue arose I didn't
have that much experience with the intricacies of NFS, so I could be
off-base.
This does bring back the permissions issue with IndexReader. A
search
app may not have permission to establish a read lock on a file within
the index directory, and in that case, an IndexFileDeleter could
delete files out from under it.
Marvin Humphrey
Rectangular Research
http://www.rectangular.com/
---------------------------------------------------------------------
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]