Core: don't close/reopen IndexWriter when changing RAM buffer size

Today we close/reopen IW when we change the RAM buffer but that's
costly because it means the next NRT reader is a full reopen.  The RAM
buffer size setting is a live one in IndexWriter, even if there are no
buffered docs in RAM when you call it.

Separately it would be nice if Lucene let you manage a "reader pool"
that could outlive individual IW instances ...

Closes #6856
This commit is contained in:
mikemccand 2014-07-15 08:32:19 -04:00
parent 557b634f4a
commit 4194ab31c8

View File

@ -234,7 +234,7 @@ public class InternalEngine extends AbstractIndexShardComponent implements Engin
if (indexingBufferSize == Engine.INACTIVE_SHARD_INDEXING_BUFFER && preValue != Engine.INACTIVE_SHARD_INDEXING_BUFFER) {
logger.debug("updating index_buffer_size from [{}] to (inactive) [{}]", preValue, indexingBufferSize);
try {
flush(new Flush().type(Flush.Type.NEW_WRITER));
flush(new Flush().type(Flush.Type.COMMIT));
} catch (EngineClosedException e) {
// ignore
} catch (FlushNotAllowedEngineException e) {