浏览代码

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
Nhat Nguyen 5 年之前
父节点
当前提交
be4562ba67
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      server/src/test/java/org/elasticsearch/indices/flush/FlushIT.java

+ 2 - 1
server/src/test/java/org/elasticsearch/indices/flush/FlushIT.java

@@ -27,6 +27,7 @@ import org.elasticsearch.common.ValidationException;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.xcontent.XContentType;
 import org.elasticsearch.index.IndexService;
+import org.elasticsearch.index.IndexSettings;
 import org.elasticsearch.indices.IndexingMemoryController;
 import org.elasticsearch.plugins.Plugin;
 import org.elasticsearch.test.ESIntegTestCase;
@@ -107,13 +108,13 @@ public class FlushIT extends ESIntegTestCase {
             .actionGet().getShardFailures(), emptyArray());
     }
 
-    @AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/52251")
     public void testFlushOnInactive() throws Exception {
         final String indexName = "flush_on_inactive";
         List<String> dataNodes = internalCluster().startDataOnlyNodes(2, Settings.builder()
             .put(IndexingMemoryController.SHARD_INACTIVE_TIME_SETTING.getKey(), randomTimeValue(10, 1000, "ms")).build());
         assertAcked(client().admin().indices().prepareCreate(indexName).setSettings(Settings.builder()
             .put(IndexMetaData.SETTING_NUMBER_OF_SHARDS, 1).put(IndexMetaData.SETTING_NUMBER_OF_REPLICAS, 1)
+            .put(IndexSettings.INDEX_TRANSLOG_SYNC_INTERVAL_SETTING.getKey(), randomTimeValue(200, 500, "ms"))
             .put(IndexService.GLOBAL_CHECKPOINT_SYNC_INTERVAL_SETTING.getKey(), randomTimeValue(50, 200, "ms"))
             .put("index.routing.allocation.include._name", String.join(",", dataNodes))
             .build()));