Skip to content

Commit

Permalink
Core: don't close/reopen IndexWriter when changing RAM buffer size
Browse files Browse the repository at this point in the history
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
  • Loading branch information
mikemccand committed Jul 15, 2014
1 parent 557b634 commit 4194ab3
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -234,7 +234,7 @@ public void updateIndexingBufferSize(ByteSizeValue indexingBufferSize) {
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) {
Expand Down

0 comments on commit 4194ab3

Please sign in to comment.