Skip to content

Commit 82796f4

Browse files
authored
Default index.shard.check_on_startup to false for searchable snapshots (#74235)
Today a searchable snapshot index inherits the index.shard.check_on_startup index setting from the snapshot it is mounted from. But this setting can require some expensive processing as documented in #74233, so we decided in #73147 to default the value of this setting to false but allow the user to override this in the mount request. Closes #73147
1 parent 2e820fc commit 82796f4

File tree

10 files changed

+87
-38
lines changed

10 files changed

+87
-38
lines changed

x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/BaseSearchableSnapshotsIntegTestCase.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import org.elasticsearch.env.NodeEnvironment;
3131
import org.elasticsearch.index.Index;
3232
import org.elasticsearch.index.IndexService;
33-
import org.elasticsearch.index.IndexSettings;
3433
import org.elasticsearch.index.engine.Engine;
3534
import org.elasticsearch.index.engine.EngineTestCase;
3635
import org.elasticsearch.index.engine.ReadOnlyEngine;
@@ -170,10 +169,7 @@ protected void mountSnapshot(
170169
repositoryName,
171170
snapshotName,
172171
indexName,
173-
Settings.builder()
174-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
175-
.put(restoredIndexSettings)
176-
.build(),
172+
restoredIndexSettings,
177173
Strings.EMPTY_ARRAY,
178174
true,
179175
storage

x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/ClusterStateApplierOrderingTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.elasticsearch.cluster.routing.UnassignedInfo;
1616
import org.elasticsearch.common.Strings;
1717
import org.elasticsearch.common.settings.Settings;
18-
import org.elasticsearch.index.IndexSettings;
1918
import org.elasticsearch.snapshots.SnapshotInfo;
2019
import org.elasticsearch.test.ESIntegTestCase;
2120
import org.elasticsearch.test.InternalTestCluster;
@@ -63,7 +62,6 @@ public void testRepositoriesServiceClusterStateApplierIsCalledBeforeIndicesClust
6362

6463
Settings.Builder indexSettingsBuilder = Settings.builder()
6564
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), false)
66-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
6765
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0);
6866

6967
final MountSearchableSnapshotRequest req = new MountSearchableSnapshotRequest(

x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/FrozenSearchableSnapshotsIntegTests.java

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ public void testCreateAndRestorePartialSearchableSnapshot() throws Exception {
8686

8787
// Peer recovery always copies .liv files but we do not permit writing to searchable snapshot directories so this doesn't work, but
8888
// we can bypass this by forcing soft deletes to be used. TODO this restriction can be lifted when #55142 is resolved.
89-
assertAcked(prepareCreate(indexName, Settings.builder().put(INDEX_SOFT_DELETES_SETTING.getKey(), true)));
89+
final Settings.Builder originalIndexSettings = Settings.builder().put(INDEX_SOFT_DELETES_SETTING.getKey(), true);
90+
if (randomBoolean()) {
91+
originalIndexSettings.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), randomFrom("false", "true", "checksum"));
92+
}
93+
assertAcked(prepareCreate(indexName, originalIndexSettings));
9094
assertAcked(client().admin().indices().prepareAliases().addAlias(indexName, aliasName));
9195

9296
populateIndex(indexName, 10_000);
@@ -141,9 +145,7 @@ public void testCreateAndRestorePartialSearchableSnapshot() throws Exception {
141145

142146
logger.info("--> restoring partial index [{}] with cache enabled", restoredIndexName);
143147

144-
Settings.Builder indexSettingsBuilder = Settings.builder()
145-
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
146-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString());
148+
Settings.Builder indexSettingsBuilder = Settings.builder().put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true);
147149
final List<String> nonCachedExtensions;
148150
if (randomBoolean()) {
149151
nonCachedExtensions = randomSubsetOf(Arrays.asList("fdt", "fdx", "nvd", "dvd", "tip", "cfs", "dim"));
@@ -164,6 +166,13 @@ public void testCreateAndRestorePartialSearchableSnapshot() throws Exception {
164166
} else {
165167
expectedReplicas = 0;
166168
}
169+
final String indexCheckOnStartup;
170+
if (randomBoolean()) {
171+
indexCheckOnStartup = randomFrom("false", "true", "checksum");
172+
indexSettingsBuilder.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), indexCheckOnStartup);
173+
} else {
174+
indexCheckOnStartup = "false";
175+
}
167176
final String expectedDataTiersPreference;
168177
expectedDataTiersPreference = getDataTiersPreference(MountSearchableSnapshotRequest.Storage.SHARED_CACHE);
169178

@@ -282,6 +291,7 @@ public void testCreateAndRestorePartialSearchableSnapshot() throws Exception {
282291
assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(settings), equalTo(expectedDataTiersPreference));
283292
assertTrue(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.get(settings));
284293
assertTrue(DiskThresholdDecider.SETTING_IGNORE_DISK_WATERMARKS.get(settings));
294+
assertThat(IndexSettings.INDEX_CHECK_ON_STARTUP.get(settings), equalTo("false"));
285295

286296
checkSoftDeletesNotEagerlyLoaded(restoredIndexName);
287297
assertTotalHits(restoredIndexName, originalAllHits, originalBarHits);

x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsCanMatchOnCoordinatorIntegTests.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
import org.elasticsearch.common.unit.ByteSizeValue;
2121
import org.elasticsearch.common.xcontent.XContentFactory;
2222
import org.elasticsearch.index.Index;
23-
import org.elasticsearch.index.IndexSettings;
2423
import org.elasticsearch.index.mapper.DateFieldMapper;
2524
import org.elasticsearch.index.query.QueryBuilders;
2625
import org.elasticsearch.index.shard.IndexLongFieldRange;
@@ -125,7 +124,6 @@ public void testSearchableSnapshotShardsAreSkippedWithoutQueryingAnyNodeWhenThey
125124

126125
// Force the searchable snapshot to be allocated in a particular node
127126
Settings restoredIndexSettings = Settings.builder()
128-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
129127
.put(INDEX_ROUTING_REQUIRE_GROUP_SETTING.getConcreteSettingForNamespace("_name").getKey(), dataNodeHoldingSearchableSnapshot)
130128
.build();
131129

@@ -260,7 +258,6 @@ public void testQueryPhaseIsExecutedInAnAvailableNodeWhenAllShardsCanBeSkipped()
260258

261259
// Force the searchable snapshot to be allocated in a particular node
262260
Settings restoredIndexSettings = Settings.builder()
263-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
264261
.put(INDEX_ROUTING_REQUIRE_GROUP_SETTING.getConcreteSettingForNamespace("_name").getKey(), dataNodeHoldingSearchableSnapshot)
265262
.build();
266263

@@ -373,7 +370,6 @@ public void testSearchableSnapshotShardsThatHaveMatchingDataAreNotSkippedOnTheCo
373370

374371
// Force the searchable snapshot to be allocated in a particular node
375372
Settings restoredIndexSettings = Settings.builder()
376-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
377373
.put(INDEX_ROUTING_REQUIRE_GROUP_SETTING.getConcreteSettingForNamespace("_name").getKey(), dataNodeHoldingSearchableSnapshot)
378374
.build();
379375

x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsIntegTests.java

Lines changed: 66 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ public void testCreateAndRestoreSearchableSnapshot() throws Exception {
109109

110110
// Peer recovery always copies .liv files but we do not permit writing to searchable snapshot directories so this doesn't work, but
111111
// we can bypass this by forcing soft deletes to be used. TODO this restriction can be lifted when #55142 is resolved.
112-
assertAcked(prepareCreate(indexName, Settings.builder().put(INDEX_SOFT_DELETES_SETTING.getKey(), true)));
112+
final Settings.Builder originalIndexSettings = Settings.builder().put(INDEX_SOFT_DELETES_SETTING.getKey(), true);
113+
if (randomBoolean()) {
114+
originalIndexSettings.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), randomFrom("false", "true", "checksum"));
115+
}
116+
assertAcked(prepareCreate(indexName, originalIndexSettings));
113117
assertAcked(client().admin().indices().prepareAliases().addAlias(indexName, aliasName));
114118

115119
populateIndex(indexName, 10_000);
@@ -166,8 +170,7 @@ public void testCreateAndRestoreSearchableSnapshot() throws Exception {
166170
logger.info("--> restoring index [{}] with cache [{}]", restoredIndexName, cacheEnabled ? "enabled" : "disabled");
167171

168172
Settings.Builder indexSettingsBuilder = Settings.builder()
169-
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), cacheEnabled)
170-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString());
173+
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), cacheEnabled);
171174
boolean preWarmEnabled = false;
172175
if (cacheEnabled) {
173176
preWarmEnabled = randomBoolean();
@@ -246,6 +249,7 @@ public void testCreateAndRestoreSearchableSnapshot() throws Exception {
246249
assertThat(IndexMetadata.INDEX_AUTO_EXPAND_REPLICAS_SETTING.get(settings).toString(), equalTo("false"));
247250
assertThat(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.get(settings), equalTo(expectedReplicas));
248251
assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(settings), equalTo(expectedDataTiersPreference));
252+
assertThat(IndexSettings.INDEX_CHECK_ON_STARTUP.get(settings), equalTo("false"));
249253

250254
checkSoftDeletesNotEagerlyLoaded(restoredIndexName);
251255
assertTotalHits(restoredIndexName, originalAllHits, originalBarHits);
@@ -430,9 +434,7 @@ public void testCanMountSnapshotTakenWhileConcurrentlyIndexing() throws Exceptio
430434

431435
logger.info("--> restoring index [{}]", restoredIndexName);
432436

433-
Settings.Builder indexSettingsBuilder = Settings.builder()
434-
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
435-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString());
437+
Settings.Builder indexSettingsBuilder = Settings.builder().put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true);
436438
final MountSearchableSnapshotRequest req = new MountSearchableSnapshotRequest(
437439
restoredIndexName,
438440
fsRepoName,
@@ -494,7 +496,7 @@ public void testMaxRestoreBytesPerSecIsUsed() throws Exception {
494496
repositoryName,
495497
snapshotName,
496498
indexName,
497-
Settings.builder().put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString()).build(),
499+
Settings.EMPTY,
498500
Strings.EMPTY_ARRAY,
499501
true,
500502
MountSearchableSnapshotRequest.Storage.FULL_COPY
@@ -567,8 +569,7 @@ public void testMountedSnapshotHasNoReplicasByDefault() throws Exception {
567569
{
568570
logger.info("--> restoring index [{}] with default replica counts", restoredIndexName);
569571
Settings.Builder indexSettingsBuilder = Settings.builder()
570-
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
571-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString());
572+
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true);
572573
final MountSearchableSnapshotRequest req = new MountSearchableSnapshotRequest(
573574
restoredIndexName,
574575
fsRepoName,
@@ -602,7 +603,6 @@ public void testMountedSnapshotHasNoReplicasByDefault() throws Exception {
602603
logger.info("--> restoring index [{}] with specific replica count", restoredIndexName);
603604
Settings.Builder indexSettingsBuilder = Settings.builder()
604605
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
605-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
606606
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, replicaCount);
607607
final MountSearchableSnapshotRequest req = new MountSearchableSnapshotRequest(
608608
restoredIndexName,
@@ -636,7 +636,6 @@ public void testMountedSnapshotHasNoReplicasByDefault() throws Exception {
636636
logger.info("--> restoring index [{}] with auto-expand replicas configured", restoredIndexName);
637637
Settings.Builder indexSettingsBuilder = Settings.builder()
638638
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
639-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
640639
.put(IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS, replicaLimit == dataNodesCount ? "0-all" : "0-" + replicaLimit);
641640
final MountSearchableSnapshotRequest req = new MountSearchableSnapshotRequest(
642641
restoredIndexName,
@@ -1094,6 +1093,62 @@ public void testSnapshotOfSearchableSnapshotCanBeRestoredBeforeRepositoryRegiste
10941093
assertTotalHits(restoredIndexName, originalAllHits, originalBarHits);
10951094
}
10961095

1096+
public void testCheckOnStartupCanBeOverridden() throws Exception {
1097+
final String suffix = getTestName().toLowerCase(Locale.ROOT);
1098+
1099+
final String index = "index_" + suffix;
1100+
final Settings.Builder indexSettings = Settings.builder();
1101+
indexSettings.put(INDEX_SOFT_DELETES_SETTING.getKey(), true);
1102+
1103+
final String checkOnStartup = randomFrom("false", "true", "checksum", null);
1104+
if (checkOnStartup != null) {
1105+
indexSettings.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), checkOnStartup);
1106+
}
1107+
createAndPopulateIndex(index, indexSettings);
1108+
1109+
final String repository = "repository_" + suffix;
1110+
createRepository(repository, "fs");
1111+
1112+
final String snapshot = "snapshot_" + suffix;
1113+
createFullSnapshot(repository, snapshot);
1114+
assertAcked(client().admin().indices().prepareDelete(index));
1115+
1116+
{
1117+
final String mountedIndex = mountSnapshot(repository, snapshot, index, Settings.EMPTY);
1118+
assertThat(
1119+
client().admin()
1120+
.indices()
1121+
.prepareGetSettings(mountedIndex)
1122+
.get()
1123+
.getIndexToSettings()
1124+
.get(mountedIndex)
1125+
.get(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey()),
1126+
equalTo("false")
1127+
);
1128+
assertAcked(client().admin().indices().prepareDelete(mountedIndex));
1129+
}
1130+
{
1131+
final String overridingCheckOnStartup = randomValueOtherThan(checkOnStartup, () -> randomFrom("false", "true", "checksum"));
1132+
final String mountedIndex = mountSnapshot(
1133+
repository,
1134+
snapshot,
1135+
index,
1136+
Settings.builder().put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), overridingCheckOnStartup).build()
1137+
);
1138+
assertThat(
1139+
client().admin()
1140+
.indices()
1141+
.prepareGetSettings(mountedIndex)
1142+
.get()
1143+
.getIndexToSettings()
1144+
.get(mountedIndex)
1145+
.get(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey()),
1146+
equalTo(overridingCheckOnStartup)
1147+
);
1148+
assertAcked(client().admin().indices().prepareDelete(mountedIndex));
1149+
}
1150+
}
1151+
10971152
private void assertSearchableSnapshotStats(String indexName, boolean cacheEnabled, List<String> nonCachedExtensions) {
10981153
final SearchableSnapshotsStatsResponse statsResponse = client().execute(
10991154
SearchableSnapshotsStatsAction.INSTANCE,

x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsLicenseIntegTests.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import org.elasticsearch.cluster.metadata.Metadata;
2626
import org.elasticsearch.common.Strings;
2727
import org.elasticsearch.common.settings.Settings;
28-
import org.elasticsearch.index.IndexSettings;
2928
import org.elasticsearch.license.DeleteLicenseAction;
3029
import org.elasticsearch.license.License;
3130
import org.elasticsearch.license.LicensesMetadata;
@@ -71,13 +70,12 @@ public void createAndMountSearchableSnapshot() throws Exception {
7170

7271
assertAcked(client().admin().indices().prepareDelete(indexName));
7372

74-
final Settings.Builder indexSettingsBuilder = Settings.builder().put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), false);
7573
final MountSearchableSnapshotRequest req = new MountSearchableSnapshotRequest(
7674
indexName,
7775
repoName,
7876
snapshotName,
7977
indexName,
80-
indexSettingsBuilder.build(),
78+
Settings.EMPTY,
8179
Strings.EMPTY_ARRAY,
8280
true,
8381
randomFrom(MountSearchableSnapshotRequest.Storage.values())

x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/SearchableSnapshotsSettingValidationIntegTests.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
import org.elasticsearch.cluster.metadata.IndexMetadata;
1212
import org.elasticsearch.common.Strings;
1313
import org.elasticsearch.common.settings.Settings;
14-
import org.elasticsearch.index.IndexSettings;
1514
import org.elasticsearch.test.ESIntegTestCase;
1615
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction;
1716
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest;
@@ -36,13 +35,12 @@ public void createAndMountSearchableSnapshot() throws Exception {
3635

3736
assertAcked(client().admin().indices().prepareDelete(indexName));
3837

39-
final Settings.Builder indexSettingsBuilder = Settings.builder().put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), false);
4038
final MountSearchableSnapshotRequest req = new MountSearchableSnapshotRequest(
4139
indexName,
4240
repoName,
4341
snapshotName,
4442
indexName,
45-
indexSettingsBuilder.build(),
43+
Settings.EMPTY,
4644
Strings.EMPTY_ARRAY,
4745
true,
4846
randomFrom(MountSearchableSnapshotRequest.Storage.values())

x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/allocation/AllocationFilteringIntegTests.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import org.elasticsearch.common.settings.Setting;
1313
import org.elasticsearch.common.settings.Settings;
1414
import org.elasticsearch.core.Nullable;
15-
import org.elasticsearch.index.IndexSettings;
1615
import org.elasticsearch.test.ESIntegTestCase;
1716
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotAction;
1817
import org.elasticsearch.xpack.core.searchablesnapshots.MountSearchableSnapshotRequest;
@@ -60,7 +59,6 @@ private MountSearchableSnapshotRequest prepareMountRequest(
6059

6160
final Settings.Builder indexSettingsBuilder = Settings.builder()
6261
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
63-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
6462
.put(mountedIndexSettings.build());
6563

6664
return new MountSearchableSnapshotRequest(

x-pack/plugin/searchable-snapshots/src/internalClusterTest/java/org/elasticsearch/xpack/searchablesnapshots/cache/shared/PartiallyCachedShardAllocationIntegTests.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import org.elasticsearch.common.util.CollectionUtils;
2929
import org.elasticsearch.common.util.concurrent.ConcurrentCollections;
3030
import org.elasticsearch.index.IndexNotFoundException;
31-
import org.elasticsearch.index.IndexSettings;
3231
import org.elasticsearch.plugins.Plugin;
3332
import org.elasticsearch.test.transport.MockTransportService;
3433
import org.elasticsearch.transport.TransportService;
@@ -88,8 +87,7 @@ private MountSearchableSnapshotRequest prepareMountRequest() throws InterruptedE
8887
assertAcked(client().admin().indices().prepareDelete(indexName));
8988

9089
final Settings.Builder indexSettingsBuilder = Settings.builder()
91-
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
92-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString());
90+
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true);
9391

9492
return new MountSearchableSnapshotRequest(
9593
indexName,

x-pack/plugin/searchable-snapshots/src/main/java/org/elasticsearch/xpack/searchablesnapshots/action/TransportMountSearchableSnapshotAction.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import org.elasticsearch.common.settings.Settings;
2828
import org.elasticsearch.common.util.concurrent.ListenableFuture;
2929
import org.elasticsearch.index.IndexNotFoundException;
30+
import org.elasticsearch.index.IndexSettings;
3031
import org.elasticsearch.indices.ShardLimitValidator;
3132
import org.elasticsearch.indices.SystemIndices;
3233
import org.elasticsearch.license.XPackLicenseState;
@@ -228,9 +229,10 @@ protected void masterOperation(
228229
}
229230
}
230231

231-
Settings indexSettings = Settings.builder()
232+
final Settings indexSettings = Settings.builder()
232233
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) // can be overridden
233234
.put(IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS, false) // can be overridden
235+
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), false) // can be overridden
234236
.put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, getDataTiersPreference(request.storage()))
235237
.put(request.indexSettings())
236238
.put(

0 commit comments

Comments
 (0)