push settings change before refresh, when shard becomes inactive

This commit is contained in:
Michael McCandless 2015-09-14 05:18:07 -04:00 committed by mikemccand
parent 9148382be0
commit 274044e7dd
1 changed files with 3 additions and 3 deletions

View File

@ -996,6 +996,9 @@ public class IndexShard extends AbstractIndexShardComponent {
// update engine if it is already started.
if (preValue.bytes() != shardIndexingBufferSize.bytes()) {
// so we push changes these changes down to IndexWriter:
engine.onSettingsChanged();
if (shardIndexingBufferSize == EngineConfig.INACTIVE_SHARD_INDEXING_BUFFER) {
// it's inactive: make sure we do a refresh / full IW flush in this case, since the memory
// changes only after a "data" change has happened to the writer
@ -1009,9 +1012,6 @@ public class IndexShard extends AbstractIndexShardComponent {
} else {
logger.debug("updating index_buffer_size from [{}] to [{}]", preValue, shardIndexingBufferSize);
}
// so we push changes these changes down to IndexWriter:
engine.onSettingsChanged();
}
engine.getTranslog().updateBuffer(shardTranslogBufferSize);