mirror of
https://github.com/apache/lucene.git
synced 2025-03-02 22:39:29 +00:00
close merge readers before checkpoint, so IFD can delete the files
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1236357 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
51c97efbe8
commit
961f3f1dff
@ -3182,7 +3182,12 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
|
||||
readerPool.drop(merge.info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Must close before checkpoint, otherwise IFD won't be
|
||||
// able to delete the held-open files from the merge
|
||||
// readers:
|
||||
closeMergeReaders(merge, false);
|
||||
|
||||
// Must note the change to segmentInfos so any commits
|
||||
// in-flight don't lose it:
|
||||
checkpoint();
|
||||
@ -3191,8 +3196,6 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
|
||||
infoStream.message("IW", "after commit: " + segString());
|
||||
}
|
||||
|
||||
closeMergeReaders(merge, false);
|
||||
|
||||
if (merge.maxNumSegments != -1 && !dropSegment) {
|
||||
// cascade the forceMerge:
|
||||
if (!segmentsToMerge.containsKey(merge.info)) {
|
||||
@ -3784,7 +3787,6 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
|
||||
|
||||
/** @lucene.internal */
|
||||
public synchronized String segString(SegmentInfo info) throws IOException {
|
||||
StringBuilder buffer = new StringBuilder();
|
||||
return info.toString(info.dir, numDeletedDocs(info) - info.getDelCount());
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user