no need to call maybe merge as part of flush, we do it async anyhow

This commit is contained in:
kimchy 2011-03-04 00:56:34 +02:00
parent 607ada75a6
commit 06ad13f373
1 changed files with 0 additions and 18 deletions

View File

@ -578,24 +578,6 @@ public class RobinEngine extends AbstractIndexShardComponent implements Engine,
// We can't do prepareCommit here, since we rely on the the segment version for the translog version
// call maybeMerge outside of the write lock since it gets called anyhow within commit/refresh
// and we want not to suffer this cost within the write lock
// only do it if we don't have an async merging going on, otherwise, we know that we won't do any
// merge operation
try {
if (indexWriter.getMergePolicy() instanceof EnableMergePolicy) {
((EnableMergePolicy) indexWriter.getMergePolicy()).enableMerge();
}
indexWriter.maybeMerge();
} catch (Exception e) {
flushing.set(false);
throw new FlushFailedEngineException(shardId, e);
} finally {
// don't allow merge when committing under write lock
if (indexWriter.getMergePolicy() instanceof EnableMergePolicy) {
((EnableMergePolicy) indexWriter.getMergePolicy()).disableMerge();
}
}
rwl.writeLock().lock();
try {
if (indexWriter == null) {