mirror of https://github.com/apache/lucene.git
LUCENE-2618: make sure optimize merge complete even if a close is pending
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1026336 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
8b4c80f04b
commit
25828363ec
|
@ -3662,8 +3662,9 @@ public class IndexWriter implements Closeable {
|
|||
// This merge (and, generally, any change to the
|
||||
// segments) may now enable new merges, so we call
|
||||
// merge policy & update pending merges.
|
||||
if (success && !merge.isAborted() && !closed && !closing)
|
||||
if (success && !merge.isAborted() && (merge.optimize || (!closed && !closing))) {
|
||||
updatePendingMerges(merge.maxNumSegmentsOptimize, merge.optimize);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (OutOfMemoryError oom) {
|
||||
|
|
Loading…
Reference in New Issue