remove files of dropped segments right after merge

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1232943 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Simon Willnauer 2012-01-18 16:10:17 +00:00
parent 374f6fc6c1
commit 3d66fa922a
1 changed files with 3 additions and 1 deletions

View File

@ -3174,6 +3174,8 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
if (dropSegment) {
readerPool.drop(merge.info);
deleter.deleteNewFiles(merge.info.files());
assert !segmentInfos.contains(merge.info);
} else {
if (mergedDeletes != null && !poolReaders) {
mergedDeletes.writeLiveDocs(directory);
@ -3191,7 +3193,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
closeMergeReaders(merge, false);
if (merge.maxNumSegments != -1) {
if (merge.maxNumSegments != -1 && !dropSegment) {
// cascade the forceMerge:
if (!segmentsToMerge.containsKey(merge.info)) {
segmentsToMerge.put(merge.info, Boolean.FALSE);