mirror of https://github.com/apache/lucene.git
don't call merged segment warmer on 100% deleted segment; drop the merged reader from the pool if it's 100% deleted
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1398850 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
17324e64dd
commit
a839ab7fb0
|
@ -34,7 +34,6 @@ import java.util.concurrent.atomic.AtomicInteger;
|
|||
|
||||
import org.apache.lucene.analysis.Analyzer;
|
||||
import org.apache.lucene.codecs.Codec;
|
||||
import org.apache.lucene.index.DocumentsWriterPerThread.FlushedSegment;
|
||||
import org.apache.lucene.index.FieldInfos.FieldNumbers;
|
||||
import org.apache.lucene.index.IndexWriterConfig.OpenMode;
|
||||
import org.apache.lucene.index.MergeState.CheckAbort;
|
||||
|
@ -42,7 +41,6 @@ import org.apache.lucene.search.Query;
|
|||
import org.apache.lucene.store.AlreadyClosedException;
|
||||
import org.apache.lucene.store.CompoundFileDirectory;
|
||||
import org.apache.lucene.store.Directory;
|
||||
import org.apache.lucene.store.FlushInfo;
|
||||
import org.apache.lucene.store.IOContext;
|
||||
import org.apache.lucene.store.Lock;
|
||||
import org.apache.lucene.store.LockObtainFailedException;
|
||||
|
@ -52,7 +50,6 @@ import org.apache.lucene.util.Bits;
|
|||
import org.apache.lucene.util.Constants;
|
||||
import org.apache.lucene.util.IOUtils;
|
||||
import org.apache.lucene.util.InfoStream;
|
||||
import org.apache.lucene.util.MutableBits;
|
||||
import org.apache.lucene.util.ThreadInterruptedException;
|
||||
|
||||
/**
|
||||
|
@ -3118,13 +3115,11 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
|
|||
mergedDeletes.dropChanges();
|
||||
}
|
||||
readerPool.release(mergedDeletes);
|
||||
if (dropSegment) {
|
||||
readerPool.drop(mergedDeletes.info);
|
||||
}
|
||||
}
|
||||
|
||||
if (dropSegment) {
|
||||
assert !segmentInfos.contains(merge.info);
|
||||
readerPool.drop(merge.info);
|
||||
deleter.deleteNewFiles(merge.info.files());
|
||||
}
|
||||
|
||||
|
@ -3736,8 +3731,7 @@ public class IndexWriter implements Closeable, TwoPhaseCommit {
|
|||
}
|
||||
|
||||
final IndexReaderWarmer mergedSegmentWarmer = config.getMergedSegmentWarmer();
|
||||
|
||||
if (poolReaders && mergedSegmentWarmer != null) {
|
||||
if (poolReaders && mergedSegmentWarmer != null && merge.info.info.getDocCount() != 0) {
|
||||
final ReadersAndLiveDocs rld = readerPool.get(merge.info, true);
|
||||
final SegmentReader sr = rld.getReader(IOContext.READ);
|
||||
try {
|
||||
|
|
Loading…
Reference in New Issue