[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:
Simon Willnauer 2014-09-23 12:29:02 +02:00
parent d4d77cdb66
commit 68c5206e50
1 changed files with 4 additions and 0 deletions

View File

@ -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();