[
https://issues.apache.org/jira/browse/LUCENE-5058?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13683322#comment-13683322
]
Christian commented on LUCENE-5058:
-----------------------------------
There is no stacktrace, since the IOException inside Lucene is not thrown.
Below is the log of the IndexWriter's infostream (The IOExceptions near the end
of the log).
IFD 0 [Fri Jun 14 14:49:24 CEST 2013; main]: init: current segments file is
"segments_3";
deletionPolicy=org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy@1c99159
IFD 0 [Fri Jun 14 14:49:24 CEST 2013; main]: init: load commit "segments_3"
IFD 0 [Fri Jun 14 14:49:24 CEST 2013; main]: now checkpoint "_1(4.3):C1
_2(4.3):C1" [2 segments ; isCommit = false]
IFD 0 [Fri Jun 14 14:49:24 CEST 2013; main]: 0 msec to checkpoint
IW 0 [Fri Jun 14 14:49:24 CEST 2013; main]: init: create=false
IW 0 [Fri Jun 14 14:49:24 CEST 2013; main]:
dir=org.apache.lucene.store.SimpleFSDirectory@D:\Workspace_Trunk_Neu\CAM\CAM_server\test
lockFactory=org.apache.lucene.store.NativeFSLockFactory@74c3aa
index=_1(4.3):C1 _2(4.3):C1
version=4.3.0 1477023 - simonw - 2013-04-29 14:50:23
matchVersion=LUCENE_43
analyzer=org.apache.lucene.analysis.standard.StandardAnalyzer
ramBufferSizeMB=16.0
maxBufferedDocs=-1
maxBufferedDeleteTerms=-1
mergedSegmentWarmer=null
readerTermsIndexDivisor=1
termIndexInterval=32
delPolicy=org.apache.lucene.index.KeepOnlyLastCommitDeletionPolicy
commit=null
openMode=CREATE_OR_APPEND
similarity=org.apache.lucene.search.similarities.DefaultSimilarity
mergeScheduler=ConcurrentMergeScheduler: maxThreadCount=1, maxMergeCount=2,
mergeThreadPriority=-1
default WRITE_LOCK_TIMEOUT=1000
writeLockTimeout=1000
codec=Lucene42
infoStream=org.apache.lucene.util.PrintStreamInfoStream
mergePolicy=[TieredMergePolicy: maxMergeAtOnce=10, maxMergeAtOnceExplicit=30,
maxMergedSegmentMB=5120.0, floorSegmentMB=2.0,
forceMergeDeletesPctAllowed=10.0, segmentsPerTier=10.0, useCompoundFile=true,
maxCFSSegmentSizeMB=8.796093022207999E12, noCFSRatio=0.1
indexerThreadPool=org.apache.lucene.index.ThreadAffinityDocumentsWriterThreadPool@1d9fd51
readerPooling=false
perThreadHardLimitMB=1945
IW 0 [Fri Jun 14 14:49:24 CEST 2013; main]: flush at getReader
DW 0 [Fri Jun 14 14:49:24 CEST 2013; main]: main startFullFlush
DW 0 [Fri Jun 14 14:49:24 CEST 2013; main]: anyChanges? numDocsInRam=1
deletes=true hasTickets:false pendingChangesInFullFlush: false
DWFC 0 [Fri Jun 14 14:49:24 CEST 2013; main]: addFlushableState
DocumentsWriterPerThread [pendingDeletes=gen=0, segment=_3, aborting=false,
numDocsInRAM=1, deleteQueue=DWDQ: [ generation: 0 ]]
DWPT 0 [Fri Jun 14 14:49:24 CEST 2013; main]: flush postings as segment _3
numDocs=1
DWPT 0 [Fri Jun 14 14:49:25 CEST 2013; main]: new segment has 0 deleted docs
DWPT 0 [Fri Jun 14 14:49:25 CEST 2013; main]: new segment has no vectors; no
norms; no docValues; no prox; no freqs
DWPT 0 [Fri Jun 14 14:49:25 CEST 2013; main]: flushedFiles=[_3.fdx,
_3_Lucene41_0.doc, _3_Lucene41_0.tip, _3.fnm, _3_Lucene41_0.tim, _3.fdt]
DWPT 0 [Fri Jun 14 14:49:25 CEST 2013; main]: flushed codec=Lucene42
DWPT 0 [Fri Jun 14 14:49:25 CEST 2013; main]: flushed: segment=_3 ramUsed=0.063
MB newFlushedSize(includes docstores)=0.001 MB docs/MB=1,833.175
DW 0 [Fri Jun 14 14:49:25 CEST 2013; main]: publishFlushedSegment seg-private
deletes=null
IW 0 [Fri Jun 14 14:49:25 CEST 2013; main]: publishFlushedSegment
BD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: push deletes 1 deleted terms
(unique count=1) bytesUsed=1024 delGen=1 packetCount=1 totBytesUsed=1024
IW 0 [Fri Jun 14 14:49:25 CEST 2013; main]: publish sets newSegment delGen=2
seg=_3(4.3):C1
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: now checkpoint "_1(4.3):C1
_2(4.3):C1 _3(4.3):C1" [3 segments ; isCommit = false]
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: 0 msec to checkpoint
IW 0 [Fri Jun 14 14:49:25 CEST 2013; main]: don't apply deletes now
delTermCount=1 bytesUsed=1024
IW 0 [Fri Jun 14 14:49:25 CEST 2013; main]: return reader version=10
reader=StandardDirectoryReader(segments_3:10:nrt _1(4.3):C1 _2(4.3):C1
_3(4.3):C1)
DW 0 [Fri Jun 14 14:49:25 CEST 2013; main]: main finishFullFlush success=true
TMP 0 [Fri Jun 14 14:49:25 CEST 2013; main]: findMerges: 3 segments
TMP 0 [Fri Jun 14 14:49:25 CEST 2013; main]: seg=_1(4.3):C1 size=0.000 MB
[floored]
TMP 0 [Fri Jun 14 14:49:25 CEST 2013; main]: seg=_2(4.3):C1 size=0.000 MB
[floored]
TMP 0 [Fri Jun 14 14:49:25 CEST 2013; main]: seg=_3(4.3):C1 size=0.000 MB
[floored]
TMP 0 [Fri Jun 14 14:49:25 CEST 2013; main]: allowedSegmentCount=1 vs count=3
(eligible count=3) tooBigCount=0
CMS 0 [Fri Jun 14 14:49:25 CEST 2013; main]: now merge
CMS 0 [Fri Jun 14 14:49:25 CEST 2013; main]: index: _1(4.3):C1 _2(4.3):C1
_3(4.3):C1
CMS 0 [Fri Jun 14 14:49:25 CEST 2013; main]: no more merges pending; now
return
IW 0 [Fri Jun 14 14:49:25 CEST 2013; main]: getReader took 194 msec
Document<stored<ID:1>>
IW 0 [Fri Jun 14 14:49:25 CEST 2013; main]: all running merges have aborted
DW 0 [Fri Jun 14 14:49:25 CEST 2013; main]: abort
DWPT 0 [Fri Jun 14 14:49:25 CEST 2013; main]: now abort
DWPT 0 [Fri Jun 14 14:49:25 CEST 2013; main]: done abort
DW 0 [Fri Jun 14 14:49:25 CEST 2013; main]: done abort; abortedFiles=null
success=true
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: now checkpoint "" [0 segments ;
isCommit = false]
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: delete "_3.fdt"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: unable to remove file "_3.fdt":
java.io.IOException: Cannot delete
D:\Workspace_Trunk_Neu\CAM\CAM_server\test\_3.fdt; Will re-try later.
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: delete "_3.fnm"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: delete "_3.fdx"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: unable to remove file "_3.fdx":
java.io.IOException: Cannot delete
D:\Workspace_Trunk_Neu\CAM\CAM_server\test\_3.fdx; Will re-try later.
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: delete "_3_Lucene41_0.doc"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: unable to remove file
"_3_Lucene41_0.doc": java.io.IOException: Cannot delete
D:\Workspace_Trunk_Neu\CAM\CAM_server\test\_3_Lucene41_0.doc; Will re-try later.
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: delete "_3_Lucene41_0.tip"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: delete "_3.si"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: delete "_3_Lucene41_0.tim"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: unable to remove file
"_3_Lucene41_0.tim": java.io.IOException: Cannot delete
D:\Workspace_Trunk_Neu\CAM\CAM_server\test\_3_Lucene41_0.tim; Will re-try later.
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: 2 msec to checkpoint
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: refresh [prefix=null]: removing
newly created unreferenced file "_3.fdt"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: delete "_3.fdt"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: unable to remove file "_3.fdt":
java.io.IOException: Cannot delete
D:\Workspace_Trunk_Neu\CAM\CAM_server\test\_3.fdt; Will re-try later.
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: refresh [prefix=null]: removing
newly created unreferenced file "_3.fdx"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: delete "_3.fdx"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: unable to remove file "_3.fdx":
java.io.IOException: Cannot delete
D:\Workspace_Trunk_Neu\CAM\CAM_server\test\_3.fdx; Will re-try later.
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: refresh [prefix=null]: removing
newly created unreferenced file "_3_Lucene41_0.doc"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: delete "_3_Lucene41_0.doc"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: unable to remove file
"_3_Lucene41_0.doc": java.io.IOException: Cannot delete
D:\Workspace_Trunk_Neu\CAM\CAM_server\test\_3_Lucene41_0.doc; Will re-try later.
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: refresh [prefix=null]: removing
newly created unreferenced file "_3_Lucene41_0.tim"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: delete "_3_Lucene41_0.tim"
IFD 0 [Fri Jun 14 14:49:25 CEST 2013; main]: unable to remove file
"_3_Lucene41_0.tim": java.io.IOException: Cannot delete
D:\Workspace_Trunk_Neu\CAM\CAM_server\test\_3_Lucene41_0.tim; Will re-try later.
> IOException when trying to delete data from index
> -------------------------------------------------
>
> Key: LUCENE-5058
> URL: https://issues.apache.org/jira/browse/LUCENE-5058
> Project: Lucene - Core
> Issue Type: Bug
> Components: core/index
> Affects Versions: 4.3
> Environment: Windows 7
> Reporter: Christian
>
> I have a small test prog which inserts some data in an index and after that,
> opens a searcher from the uncommitted index to search on and output the
> result to std.out. The Searcher is immediately closed. Then, i call
> deleteAll() on the index but it encounters an IOException stating that the
> index files could not be removed. I have investigated with Sysinternals and
> it says the file is still locked despite the fact that the index searcher is
> correctly closed. If i call deleteAll() without opening a searcher before it
> just works fine as expected. This seems to be a bug in Lucene, since closing
> the index searcher makes it impossible to delete the index.
> Here is the source code:
> {code:title=Bar.java|borderStyle=solid}
> public class LuceneTest {
> private Directory dir;
> private IndexWriter writer;
>
> public void addDocs(long value) throws IOException {
> Document doc = new Document();
> doc.add(new LongField("ID", value, Field.Store.YES));
> writer.deleteDocuments(new Term("ID", "1"));
> writer.addDocument(doc);
> }
>
> public void search() throws IOException {
> IndexSearcher searcher = new IndexSearcher(DirectoryReader.open(writer,
> false));
> TopDocs results =
> searcher.search(NumericRangeQuery.newLongRange("ID", 1L, 2L, true, true), 1);
>
> for ( ScoreDoc sc : results.scoreDocs) {
> System.out.println(searcher.doc(sc.doc));
> }
>
> searcher.getIndexReader().close();
> }
> public static void main(String[] args) throws IOException {
> new LuceneTest();
> }
>
> public LuceneTest() throws IOException {
> dir = FSDirectory.open(new File("test"));
> IndexWriterConfig config = new IndexWriterConfig(Version.LUCENE_43,
> new StandardAnalyzer(Version.LUCENE_43));
> config.setInfoStream(System.out);
> writer = new IndexWriter(dir, config);
>
> addDocs(1L);
> search();
> //writer.commit(); -- If i call commit after search, then no
> IOException occurrs!
>
> writer.deleteAll();
> }
> }
> {code}
--
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: [email protected]
For additional commands, e-mail: [email protected]