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

Michael McCandless commented on LUCENE-3422:
--------------------------------------------

If you are keeping an IndexWriter open across multiple changes, then you should 
not see a new segment (set of _N.* files) after each entity save, i.e. 
IndexWriter instead should be buffering 2MB worth of changes and only then 
flushing a new segment.

When a merge completes, it's only after updating the SegmentInfos that it goes 
and deletes files from the directory.

Is it possible you accidentally have two IndexWriters open on the same 
directory?  Are you changing the LockFactory used by the Directory (the purpose 
of locking is to prevent two IndexWriters on one directory).
                
> IndeIndexWriter.optimize() throws FileNotFoundException and IOException
> -----------------------------------------------------------------------
>
>                 Key: LUCENE-3422
>                 URL: https://issues.apache.org/jira/browse/LUCENE-3422
>             Project: Lucene - Core
>          Issue Type: Bug
>            Reporter: Elizabeth Nisha
>
> I am using lucene 3.0.2 search APIs for my application. 
> Indexed data is about 350MB and time taken for indexing is 25 hrs. Search 
> indexing and Optimization runs in two different threads. Optimization runs 
> for every 1 hour and it doesn't run while indexing is going on and vice 
> versa. When optimization is going on using IndexWriter.optimize(), 
> FileNotFoundException and IOException are seen in my log and the index file 
> is getting corrupted, log says
> 1. java.io.IOException: No sub-file with id _5r8.fdt found 
> [The file name in this message changes over time (_5r8.fdt, _6fa.fdt, 
> _6uh.fdt, ..., _emv.fdt) ]
> 2. java.io.FileNotFoundException: 
> /local/groups/necim/index_5.3/index/_bdx.cfs (No such file or directory)  
> 3. java.io.FileNotFoundException: 
> /local/groups/necim/index_5.3/index/_hkq.cfs (No such file or directory)
>       Stack trace: java.io.IOException: background merge hit exception: 
> _hkp:c100->_hkp _hkq:c100->_hkp _hkr:c100->_hkr _hks:c100->_hkr _hxb:c5500 
> _hx5:c1000 _hxc:c198
> 84 into _hxd [optimize] [mergeDocStores]
>        at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2359)
>        at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2298)
>        at org.apache.lucene.index.IndexWriter.optimize(IndexWriter.java:2268)
>        at com.telelogic.cs.search.SearchIndex.doOptimize(SearchIndex.java:130)
>        at 
> com.telelogic.cs.search.SearchIndexerThread$1.run(SearchIndexerThread.java:337)
>        at 
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
>        at 
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
>        at java.lang.Thread.run(Thread.java:662)
> Caused by: java.io.FileNotFoundException: 
> /local/groups/necim/index_5.3/index/_hkq.cfs (No such file or directory)
>        at java.io.RandomAccessFile.open(Native Method)
>        at java.io.RandomAccessFile.<init>(RandomAccessFile.java:212)
>        at 
> org.apache.lucene.store.SimpleFSDirectory$SimpleFSIndexInput$Descriptor.<init>(SimpleFSDirectory.java:76)
>        at 
> org.apache.lucene.store.SimpleFSDirectory$SimpleFSIndexInput.<init>(SimpleFSDirectory.java:97)
>        at 
> org.apache.lucene.store.NIOFSDirectory$NIOFSIndexInput.<init>(NIOFSDirectory.java:87)
>        at 
> org.apache.lucene.store.NIOFSDirectory.openInput(NIOFSDirectory.java:67)
>        at 
> org.apache.lucene.index.CompoundFileReader.<init>(CompoundFileReader.java:67)
>        at 
> org.apache.lucene.index.SegmentReader$CoreReaders.<init>(SegmentReader.java:114)
>        at org.apache.lucene.index.SegmentReader.get(SegmentReader.java:590)
>        at 
> org.apache.lucene.index.IndexWriter$ReaderPool.get(IndexWriter.java:616)
>        at 
> org.apache.lucene.index.IndexWriter.mergeMiddle(IndexWriter.java:4309)
>        at org.apache.lucene.index.IndexWriter.merge(IndexWriter.java:3965)
>        at 
> org.apache.lucene.index.ConcurrentMergeScheduler.doMerge(ConcurrentMergeScheduler.java:231)
>        at 
> org.apache.lucene.index.ConcurrentMergeScheduler$MergeThread.run(ConcurrentMergeScheduler.java:288)
>  

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org
For additional commands, e-mail: dev-h...@lucene.apache.org

Reply via email to