Skip to content

Commit

Permalink
Force flush in translog retention policy test (#47879)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dnhatn authored Oct 12, 2019
1 parent 585a1aa commit 6731e9f
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ public void testNoOpEngineFactoryTakesPrecedence() {
}
}

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

Expand Down

0 comments on commit 6731e9f

Please sign in to comment.