[TEST] disable translog based flushes when corrupting files
These tests rely on the fact that all files stay the same after the corruption and if we run into a translog based flush we might use a new / different delete file causing the test to fail.
This commit is contained in:
parent
d4d77cdb66
commit
68c5206e50
|
@ -61,6 +61,7 @@ import org.elasticsearch.index.shard.IndexShardState;
|
|||
import org.elasticsearch.index.shard.ShardId;
|
||||
import org.elasticsearch.index.shard.service.IndexShard;
|
||||
import org.elasticsearch.index.shard.service.InternalIndexShard;
|
||||
import org.elasticsearch.index.translog.TranslogService;
|
||||
import org.elasticsearch.indices.IndicesLifecycle;
|
||||
import org.elasticsearch.indices.IndicesService;
|
||||
import org.elasticsearch.indices.recovery.RecoveryFileChunkRequest;
|
||||
|
@ -118,6 +119,7 @@ public class CorruptedFileTest extends ElasticsearchIntegrationTest {
|
|||
.put(MergePolicyModule.MERGE_POLICY_TYPE_KEY, NoMergePolicyProvider.class)
|
||||
.put(MockFSDirectoryService.CHECK_INDEX_ON_CLOSE, false) // no checkindex - we corrupt shards on purpose
|
||||
.put(InternalEngine.INDEX_FAIL_ON_CORRUPTION, failOnCorruption)
|
||||
.put(TranslogService.INDEX_TRANSLOG_DISABLE_FLUSH, true) // no translog based flush - it might change the .del / segments.N files
|
||||
.put("indices.recovery.concurrent_streams", 10)
|
||||
));
|
||||
if (failOnCorruption == false) { // test the dynamic setting
|
||||
|
@ -226,6 +228,7 @@ public class CorruptedFileTest extends ElasticsearchIntegrationTest {
|
|||
.put(MergePolicyModule.MERGE_POLICY_TYPE_KEY, NoMergePolicyProvider.class)
|
||||
.put(MockFSDirectoryService.CHECK_INDEX_ON_CLOSE, false) // no checkindex - we corrupt shards on purpose
|
||||
.put(InternalEngine.INDEX_FAIL_ON_CORRUPTION, true)
|
||||
.put(TranslogService.INDEX_TRANSLOG_DISABLE_FLUSH, true) // no translog based flush - it might change the .del / segments.N files
|
||||
.put("indices.recovery.concurrent_streams", 10)
|
||||
));
|
||||
ensureGreen();
|
||||
|
@ -397,6 +400,7 @@ public class CorruptedFileTest extends ElasticsearchIntegrationTest {
|
|||
.put(MergePolicyModule.MERGE_POLICY_TYPE_KEY, NoMergePolicyProvider.class)
|
||||
.put(MockFSDirectoryService.CHECK_INDEX_ON_CLOSE, false) // no checkindex - we corrupt shards on purpose
|
||||
.put(InternalEngine.INDEX_FAIL_ON_CORRUPTION, true)
|
||||
.put(TranslogService.INDEX_TRANSLOG_DISABLE_FLUSH, true) // no translog based flush - it might change the .del / segments.N files
|
||||
.put("indices.recovery.concurrent_streams", 10)
|
||||
));
|
||||
ensureGreen();
|
||||
|
|
Loading…
Reference in New Issue