|
|
@@ -183,8 +183,15 @@ public final class IndexSettings {
|
|
|
Setting.timeSetting("index.refresh_interval", DEFAULT_REFRESH_INTERVAL, new TimeValue(-1, TimeUnit.MILLISECONDS),
|
|
|
Property.Dynamic, Property.IndexScope);
|
|
|
public static final Setting<ByteSizeValue> INDEX_TRANSLOG_FLUSH_THRESHOLD_SIZE_SETTING =
|
|
|
- Setting.byteSizeSetting("index.translog.flush_threshold_size", new ByteSizeValue(512, ByteSizeUnit.MB), Property.Dynamic,
|
|
|
- Property.IndexScope);
|
|
|
+ Setting.byteSizeSetting("index.translog.flush_threshold_size", new ByteSizeValue(512, ByteSizeUnit.MB),
|
|
|
+ /*
|
|
|
+ * An empty translog occupies 43 bytes on disk. If the flush threshold is below this, the flush thread
|
|
|
+ * can get stuck in an infinite loop as the shouldPeriodicallyFlush can still be true after flushing.
|
|
|
+ * However, small thresholds are useful for testing so we do not add a large lower bound here.
|
|
|
+ */
|
|
|
+ new ByteSizeValue(Translog.DEFAULT_HEADER_SIZE_IN_BYTES + 1, ByteSizeUnit.BYTES),
|
|
|
+ new ByteSizeValue(Long.MAX_VALUE, ByteSizeUnit.BYTES),
|
|
|
+ Property.Dynamic, Property.IndexScope);
|
|
|
|
|
|
/**
|
|
|
* Controls how long translog files that are no longer needed for persistence reasons
|
|
|
@@ -219,9 +226,9 @@ public final class IndexSettings {
|
|
|
* generation threshold. However, small thresholds are useful for testing so we
|
|
|
* do not add a large lower bound here.
|
|
|
*/
|
|
|
- new ByteSizeValue(64, ByteSizeUnit.BYTES),
|
|
|
+ new ByteSizeValue(Translog.DEFAULT_HEADER_SIZE_IN_BYTES + 1, ByteSizeUnit.BYTES),
|
|
|
new ByteSizeValue(Long.MAX_VALUE, ByteSizeUnit.BYTES),
|
|
|
- new Property[]{Property.Dynamic, Property.IndexScope});
|
|
|
+ Property.Dynamic, Property.IndexScope);
|
|
|
|
|
|
/**
|
|
|
* Index setting to enable / disable deletes garbage collection.
|