lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claudio Deluca <decl...@gmail.com>
Subject Stale NFS file handle Exception
Date Thu, 14 Jan 2010 06:25:54 GMT
Hi,
We are using Lucene 2.4.1 in a load-balanced environment.
The lucene index is stored on server a while server b accesses the index
though an nfs share.

After creating the instance of IndexWriter, the documents are beeing added
and the index gets optimized and closed.
*IndexWriter theIndexWriter = new IndexWriter(new File(indexerPath), new
WhitespaceAnalyzer(), true, IndexWriter.MaxFieldLength.UNLIMITED);
...
theIndexWriter.optimize();
theIndexWriter.close();*

For serach we open the index on application startup like this
*Directory theDirectory = FSDirectory.getDirectory(theConfigPath);
IndexReader indexReader = IndexReader.open(theDirectory, true);
IndexSearcher searcher = new IndexSearcher(indexReader);*

The exception appears, when server a finished recreation of index (closed
the indexwriter) and server b executes a search query over the index.
Only if we restart the application the problem does not longer appear,
because at this point the index will be newly opened.

How can we avoid this Exception?

java.io.IOException: Stale NFS file handle
	at java.io.RandomAccessFile.readBytes(Native Method)
	at java.io.RandomAccessFile.read(Unknown Source)
	at org.apache.lucene.store.FSDirectory$FSIndexInput.readInternal(FSDirectory.java:596)
	at org.apache.lucene.store.BufferedIndexInput.readBytes(BufferedIndexInput.java:136)
	at org.apache.lucene.index.CompoundFileReader$CSIndexInput.readInternal(CompoundFileReader.java:247)
	at org.apache.lucene.store.BufferedIndexInput.refill(BufferedIndexInput.java:157)
	at org.apache.lucene.store.BufferedIndexInput.readByte(BufferedIndexInput.java:38)
	at org.apache.lucene.store.IndexInput.readVInt(IndexInput.java:78)
	at org.apache.lucene.index.SegmentTermDocs.next(SegmentTermDocs.java:110)
	at org.apache.lucene.index.SegmentTermPositions.next(SegmentTermPositions.java:98)
	at org.apache.lucene.search.PhrasePositions.next(PhrasePositions.java:41)
	at org.apache.lucene.search.PhraseScorer.init(PhraseScorer.java:131)
	at org.apache.lucene.search.PhraseScorer.next(PhraseScorer.java:76)
	at org.apache.lucene.search.ConjunctionScorer.init(ConjunctionScorer.java:80)
	at org.apache.lucene.search.ConjunctionScorer.next(ConjunctionScorer.java:48)
	at org.apache.lucene.search.BooleanScorer2.score(BooleanScorer2.java:319)
	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:136)
	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:123)
	at org.apache.lucene.search.Searcher.search(Searcher.java:86)


Thanks,
Claudio

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message