Force flush in translog retention policy test (#47879)

If we roll translog but do not index, then a flush without force is a 
noop. In this case, the number of retained translog files will be higher
than the value specified by the retention policy.

Closes #4741
This commit is contained in:
Nhat Nguyen 2019-10-11 21:09:54 -04:00
parent 46ae86ac31
commit 4c1bb210cb
1 changed files with 2 additions and 2 deletions

View File

@ -857,7 +857,7 @@ public class IndexShardIT extends ESSingleNodeTestCase {
}
}
public void testLimitNumberOfRetainingTranslogFiles() throws Exception {
public void testLimitNumberOfRetainedTranslogFiles() throws Exception {
String indexName = "test";
int translogRetentionTotalFiles = randomIntBetween(0, 50);
Settings.Builder settings = Settings.builder()
@ -890,7 +890,7 @@ public class IndexShardIT extends ESSingleNodeTestCase {
shard.rollTranslogGeneration();
}
}
client().admin().indices().prepareFlush(indexName).get();
client().admin().indices().prepareFlush(indexName).setForce(true).setWaitIfOngoing(true).get();
checkTranslog.run();
}