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:
parent
46ae86ac31
commit
4c1bb210cb
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue