diff --git a/server/src/internalClusterTest/java/org/opensearch/cluster/metadata/ClusterIndexRefreshIntervalIT.java b/server/src/internalClusterTest/java/org/opensearch/cluster/metadata/ClusterIndexRefreshIntervalIT.java index 69f8b1dabafb0..f936b53f52a7b 100644 --- a/server/src/internalClusterTest/java/org/opensearch/cluster/metadata/ClusterIndexRefreshIntervalIT.java +++ b/server/src/internalClusterTest/java/org/opensearch/cluster/metadata/ClusterIndexRefreshIntervalIT.java @@ -242,7 +242,6 @@ public void testRefreshIntervalDisabled() throws ExecutionException, Interrupted .put(IndexSettings.INDEX_REFRESH_INTERVAL_SETTING.getKey(), IndexSettings.MINIMUM_REFRESH_INTERVAL) .build(); createIndex(INDEX_NAME, settings); - ensureYellowAndNoInitializingShards(INDEX_NAME); ensureGreen(INDEX_NAME); GetIndexResponse getIndexResponse = client(clusterManagerName).admin().indices().getIndex(new GetIndexRequest()).get(); IndicesService indicesService = internalCluster().getInstance(IndicesService.class, randomFrom(dataNodes)); diff --git a/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java b/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java index a983c627b8a75..2141ab2bbb299 100644 --- a/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java +++ b/server/src/main/java/org/opensearch/cluster/metadata/MetadataCreateIndexService.java @@ -1503,8 +1503,7 @@ public static void validateRefreshIntervalSettings(Settings requestSettings, Clu } TimeValue requestRefreshInterval = IndexSettings.INDEX_REFRESH_INTERVAL_SETTING.get(requestSettings); // If the refresh interval supplied is -1, we allow the index to be created because -1 means no periodic refresh. - if (requestRefreshInterval.millis() < 0) { - assert requestRefreshInterval.millis() == -1; + if (requestRefreshInterval.millis() == -1) { return; } TimeValue clusterMinimumRefreshInterval = clusterSettings.get(IndicesService.CLUSTER_MINIMUM_INDEX_REFRESH_INTERVAL_SETTING);