Skip to content

Commit 6731e9f

Browse files
authored
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 585a1aa commit 6731e9f

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
@@ -855,7 +855,7 @@ public void testNoOpEngineFactoryTakesPrecedence() {
855855
}
856856
}
857857

858-
public void testLimitNumberOfRetainingTranslogFiles() throws Exception {
858+
public void testLimitNumberOfRetainedTranslogFiles() throws Exception {
859859
String indexName = "test";
860860
int translogRetentionTotalFiles = randomIntBetween(0, 50);
861861
Settings.Builder settings = Settings.builder()
@@ -888,7 +888,7 @@ public void testLimitNumberOfRetainingTranslogFiles() throws Exception {
888888
shard.rollTranslogGeneration();
889889
}
890890
}
891-
client().admin().indices().prepareFlush(indexName).get();
891+
client().admin().indices().prepareFlush(indexName).setForce(true).setWaitIfOngoing(true).get();
892892
checkTranslog.run();
893893
}
894894

0 commit comments

Comments
 (0)