Skip to content

Commit be4562b

Browse files
authored
Fix testFlushOnInactive (#52275)
We need to reduce the translog sync interval for indices with translog async setting so that we can have the safe commit in the assertBusy interval. This is needed since #51905, where we use the local checkpoint of the safe commit to calculate the number of uncommitted operations of a translog stats. Closes #52251 Relates #51905
1 parent b847742 commit be4562b

File tree

1 file changed

+2
-1
lines changed
  • server/src/test/java/org/elasticsearch/indices/flush

1 file changed

+2
-1
lines changed

server/src/test/java/org/elasticsearch/indices/flush/FlushIT.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.common.settings.Settings;
2828
import org.elasticsearch.common.xcontent.XContentType;
2929
import org.elasticsearch.index.IndexService;
30+
import org.elasticsearch.index.IndexSettings;
3031
import org.elasticsearch.indices.IndexingMemoryController;
3132
import org.elasticsearch.plugins.Plugin;
3233
import org.elasticsearch.test.ESIntegTestCase;
@@ -107,13 +108,13 @@ public void testRejectIllegalFlushParameters() {
107108
.actionGet().getShardFailures(), emptyArray());
108109
}
109110

110-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/52251")
111111
public void testFlushOnInactive() throws Exception {
112112
final String indexName = "flush_on_inactive";
113113
List<String> dataNodes = internalCluster().startDataOnlyNodes(2, Settings.builder()
114114
.put(IndexingMemoryController.SHARD_INACTIVE_TIME_SETTING.getKey(), randomTimeValue(10, 1000, "ms")).build());
115115
assertAcked(client().admin().indices().prepareCreate(indexName).setSettings(Settings.builder()
116116
.put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 1)
117+
.put(IndexSettings.INDEX_TRANSLOG_SYNC_INTERVAL_SETTING.getKey(), randomTimeValue(200, 500, "ms"))
117118
.put(IndexService.GLOBAL_CHECKPOINT_SYNC_INTERVAL_SETTING.getKey(), randomTimeValue(50, 200, "ms"))
118119
.put("index.routing.allocation.include._name", String.join(",", dataNodes))
119120
.build()));

0 commit comments

Comments
 (0)