reduce the number of iterations in testPrimaryRelocationWhileIndexing and flush every 5

Without flushing the translog doubles it's size on every recovery
This commit is contained in:
Boaz Leskes 2017-02-26 19:15:33 +01:00
parent 9088ddd09c
commit 396b8b371c
1 changed files with 5 additions and 2 deletions

View File

@ -42,7 +42,7 @@ import static org.hamcrest.Matchers.equalTo;
@ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST) @ESIntegTestCase.ClusterScope(scope = ESIntegTestCase.Scope.TEST)
public class IndexPrimaryRelocationIT extends ESIntegTestCase { public class IndexPrimaryRelocationIT extends ESIntegTestCase {
private static final int RELOCATION_COUNT = 25; private static final int RELOCATION_COUNT = 15;
@TestLogging("_root:DEBUG,org.elasticsearch.action.bulk:TRACE,org.elasticsearch.index.shard:TRACE,org.elasticsearch.cluster.service:TRACE") @TestLogging("_root:DEBUG,org.elasticsearch.action.bulk:TRACE,org.elasticsearch.index.shard:TRACE,org.elasticsearch.cluster.service:TRACE")
public void testPrimaryRelocationWhileIndexing() throws Exception { public void testPrimaryRelocationWhileIndexing() throws Exception {
@ -88,7 +88,10 @@ public class IndexPrimaryRelocationIT extends ESIntegTestCase {
if (indexingThread.isAlive() == false) { // indexing process aborted early, no need for more relocations as test has already failed if (indexingThread.isAlive() == false) { // indexing process aborted early, no need for more relocations as test has already failed
break; break;
} }
if (i > 0 && i % 5 == 0) {
logger.info("--> [iteration {}] flushing index", i);
client().admin().indices().prepareFlush("test").get();
}
} }
finished.set(true); finished.set(true);
indexingThread.join(); indexingThread.join();