[TEST] Randomize translog settings
This commit is contained in:
parent
644fd00714
commit
8f163ad4b0
|
@ -79,6 +79,8 @@ import org.elasticsearch.index.shard.IndexShardModule;
|
||||||
import org.elasticsearch.index.shard.IndexShardState;
|
import org.elasticsearch.index.shard.IndexShardState;
|
||||||
import org.elasticsearch.index.shard.ShardId;
|
import org.elasticsearch.index.shard.ShardId;
|
||||||
import org.elasticsearch.index.store.IndexStoreModule;
|
import org.elasticsearch.index.store.IndexStoreModule;
|
||||||
|
import org.elasticsearch.index.translog.Translog;
|
||||||
|
import org.elasticsearch.index.translog.TranslogFile;
|
||||||
import org.elasticsearch.indices.IndicesService;
|
import org.elasticsearch.indices.IndicesService;
|
||||||
import org.elasticsearch.indices.breaker.CircuitBreakerService;
|
import org.elasticsearch.indices.breaker.CircuitBreakerService;
|
||||||
import org.elasticsearch.indices.breaker.HierarchyCircuitBreakerService;
|
import org.elasticsearch.indices.breaker.HierarchyCircuitBreakerService;
|
||||||
|
@ -437,6 +439,15 @@ public final class InternalTestCluster extends TestCluster {
|
||||||
builder.put(FilterCacheSettings.FILTER_CACHE_EVERYTHING, random.nextBoolean());
|
builder.put(FilterCacheSettings.FILTER_CACHE_EVERYTHING, random.nextBoolean());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (random.nextBoolean()) {
|
||||||
|
builder.put(Translog.INDEX_TRANSLOG_FS_TYPE, RandomPicks.randomFrom(random, TranslogFile.Type.values()));
|
||||||
|
if (random.nextBoolean()) {
|
||||||
|
builder.put(Translog.INDEX_TRANSLOG_SYNC_INTERVAL, 0); // 0 has special meaning to sync each op
|
||||||
|
} else {
|
||||||
|
builder.put(Translog.INDEX_TRANSLOG_SYNC_INTERVAL, RandomInts.randomIntBetween(random, 100, 5000));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue