mirror of
https://github.com/apache/lucene.git
synced 2025-02-20 17:07:09 +00:00
Fixed a bug where obsolete segment files were not deleted on Win32.
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@150362 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
27821a7f9a
commit
5ca4cb27e2
@ -25,6 +25,8 @@ $Id$
|
||||
termFreq(), termDocs() or termPositions() to improve
|
||||
multi-threaded performance. (cutting)
|
||||
|
||||
6. Fix a bug where obsolete segment files were not deleted on Win32.
|
||||
|
||||
|
||||
1.4 RC3
|
||||
|
||||
|
@ -490,6 +490,9 @@ public class IndexWriter {
|
||||
segmentInfos.addElement(new SegmentInfo(mergedName, mergedDocCount,
|
||||
directory));
|
||||
|
||||
// close readers before we attempt to delete now-obsolete segments
|
||||
merger.closeReaders();
|
||||
|
||||
synchronized (directory) { // in- & inter-process sync
|
||||
new Lock.With(directory.makeLock(IndexWriter.COMMIT_LOCK_NAME), COMMIT_LOCK_TIMEOUT) {
|
||||
public Object doBody() throws IOException {
|
||||
@ -499,8 +502,7 @@ public class IndexWriter {
|
||||
}
|
||||
}.run();
|
||||
}
|
||||
|
||||
merger.closeReaders();
|
||||
|
||||
}
|
||||
|
||||
/* Some operating systems (e.g. Windows) don't permit a file to be deleted
|
||||
|
Loading…
x
Reference in New Issue
Block a user