Skip to content

Commit 4c1bb21

Browse files
committed
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
1 parent 46ae86a commit 4c1bb21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

server/src/test/java/org/elasticsearch/index/shard/IndexShardIT.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ public void testNoOpEngineFactoryTakesPrecedence() {
857857
}
858858
}
859859

860-
public void testLimitNumberOfRetainingTranslogFiles() throws Exception {
860+
public void testLimitNumberOfRetainedTranslogFiles() throws Exception {
861861
String indexName = "test";
862862
int translogRetentionTotalFiles = randomIntBetween(0, 50);
863863
Settings.Builder settings = Settings.builder()
@@ -890,7 +890,7 @@ public void testLimitNumberOfRetainingTranslogFiles() throws Exception {
890890
shard.rollTranslogGeneration();
891891
}
892892
}
893-
client().admin().indices().prepareFlush(indexName).get();
893+
client().admin().indices().prepareFlush(indexName).setForce(true).setWaitIfOngoing(true).get();
894894
checkTranslog.run();
895895
}
896896

0 commit comments

Comments
 (0)