LUCENE-2680: deletes were being double-applied

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1063936 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2011-01-27 00:42:58 +00:00
parent 51dc4159e6
commit 5a9c5aae0b
1 changed files with 5 additions and 4 deletions

View File

@ -2895,10 +2895,6 @@ public class IndexWriter implements Closeable {
final synchronized void mergeInit(MergePolicy.OneMerge merge) throws IOException {
boolean success = false;
try {
// Lock order: IW -> BD
if (bufferedDeletes.applyDeletes(readerPool, segmentInfos, merge.segments)) {
checkpoint();
}
_mergeInit(merge);
success = true;
} finally {
@ -2929,6 +2925,11 @@ public class IndexWriter implements Closeable {
if (merge.isAborted())
return;
// Lock order: IW -> BD
if (bufferedDeletes.applyDeletes(readerPool, segmentInfos, merge.segments)) {
checkpoint();
}
// Bind a new segment name here so even with
// ConcurrentMergePolicy we keep deterministic segment
// names.