Skip to content

Commit 04bca48

Browse files
authored
[7.x] Default index.shard.check_on_startup to false for searchable snapshots (elastic#74279)
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 elastic#74233, so we decided in elastic#73147 to default the value of this setting to false but allow the user to override this in the mount request. Backport of elastic#74235 Closes elastic#73147
1 parent 50eea80 commit 04bca48

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
@@ -28,7 +28,6 @@
2828
import org.elasticsearch.env.NodeEnvironment;
2929
import org.elasticsearch.index.Index;
3030
import org.elasticsearch.index.IndexService;
31-
import org.elasticsearch.index.IndexSettings;
3231
import org.elasticsearch.index.engine.Engine;
3332
import org.elasticsearch.index.engine.EngineTestCase;
3433
import org.elasticsearch.index.engine.ReadOnlyEngine;
@@ -171,10 +170,7 @@ protected void mountSnapshot(
171170
repositoryName,
172171
snapshotName,
173172
indexName,
174-
Settings.builder()
175-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
176-
.put(restoredIndexSettings)
177-
.build(),
173+
restoredIndexSettings,
178174
Strings.EMPTY_ARRAY,
179175
true,
180176
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;
@@ -65,7 +64,6 @@ public void testRepositoriesServiceClusterStateApplierIsCalledBeforeIndicesClust
6564

6665
Settings.Builder indexSettingsBuilder = Settings.builder()
6766
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), false)
68-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
6967
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0);
7068

7169
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(indexCheckOnStartup));
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.xcontent.XContentFactory;
2121
import org.elasticsearch.core.List;
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;
@@ -119,7 +118,6 @@ public void testSearchableSnapshotShardsAreSkippedWithoutQueryingAnyNodeWhenThey
119118

120119
// Force the searchable snapshot to be allocated in a particular node
121120
Settings restoredIndexSettings = Settings.builder()
122-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
123121
.put(INDEX_ROUTING_REQUIRE_GROUP_SETTING.getConcreteSettingForNamespace("_name").getKey(), dataNodeHoldingSearchableSnapshot)
124122
.build();
125123

@@ -254,7 +252,6 @@ public void testQueryPhaseIsExecutedInAnAvailableNodeWhenAllShardsCanBeSkipped()
254252

255253
// Force the searchable snapshot to be allocated in a particular node
256254
Settings restoredIndexSettings = Settings.builder()
257-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
258255
.put(INDEX_ROUTING_REQUIRE_GROUP_SETTING.getConcreteSettingForNamespace("_name").getKey(), dataNodeHoldingSearchableSnapshot)
259256
.build();
260257

@@ -367,7 +364,6 @@ public void testSearchableSnapshotShardsThatHaveMatchingDataAreNotSkippedOnTheCo
367364

368365
// Force the searchable snapshot to be allocated in a particular node
369366
Settings restoredIndexSettings = Settings.builder()
370-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
371367
.put(INDEX_ROUTING_REQUIRE_GROUP_SETTING.getConcreteSettingForNamespace("_name").getKey(), dataNodeHoldingSearchableSnapshot)
372368
.build();
373369

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
@@ -111,7 +111,11 @@ public void testCreateAndRestoreSearchableSnapshot() throws Exception {
111111

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

117121
populateIndex(indexName, 10_000);
@@ -168,8 +172,7 @@ public void testCreateAndRestoreSearchableSnapshot() throws Exception {
168172
logger.info("--> restoring index [{}] with cache [{}]", restoredIndexName, cacheEnabled ? "enabled" : "disabled");
169173

170174
Settings.Builder indexSettingsBuilder = Settings.builder()
171-
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), cacheEnabled)
172-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString());
175+
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), cacheEnabled);
173176
boolean preWarmEnabled = false;
174177
if (cacheEnabled) {
175178
preWarmEnabled = randomBoolean();
@@ -248,6 +251,7 @@ public void testCreateAndRestoreSearchableSnapshot() throws Exception {
248251
assertThat(IndexMetadata.INDEX_AUTO_EXPAND_REPLICAS_SETTING.get(settings).toString(), equalTo("false"));
249252
assertThat(IndexMetadata.INDEX_NUMBER_OF_REPLICAS_SETTING.get(settings), equalTo(expectedReplicas));
250253
assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(settings), equalTo(expectedDataTiersPreference));
254+
assertThat(IndexSettings.INDEX_CHECK_ON_STARTUP.get(settings), equalTo("false"));
251255

252256
checkSoftDeletesNotEagerlyLoaded(restoredIndexName);
253257
assertTotalHits(restoredIndexName, originalAllHits, originalBarHits);
@@ -432,9 +436,7 @@ public void testCanMountSnapshotTakenWhileConcurrentlyIndexing() throws Exceptio
432436

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

435-
Settings.Builder indexSettingsBuilder = Settings.builder()
436-
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
437-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString());
439+
Settings.Builder indexSettingsBuilder = Settings.builder().put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true);
438440
final MountSearchableSnapshotRequest req = new MountSearchableSnapshotRequest(
439441
restoredIndexName,
440442
fsRepoName,
@@ -496,7 +498,7 @@ public void testMaxRestoreBytesPerSecIsUsed() throws Exception {
496498
repositoryName,
497499
snapshotName,
498500
indexName,
499-
Settings.builder().put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString()).build(),
501+
Settings.EMPTY,
500502
Strings.EMPTY_ARRAY,
501503
true,
502504
MountSearchableSnapshotRequest.Storage.FULL_COPY
@@ -569,8 +571,7 @@ public void testMountedSnapshotHasNoReplicasByDefault() throws Exception {
569571
{
570572
logger.info("--> restoring index [{}] with default replica counts", restoredIndexName);
571573
Settings.Builder indexSettingsBuilder = Settings.builder()
572-
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
573-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString());
574+
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true);
574575
final MountSearchableSnapshotRequest req = new MountSearchableSnapshotRequest(
575576
restoredIndexName,
576577
fsRepoName,
@@ -604,7 +605,6 @@ public void testMountedSnapshotHasNoReplicasByDefault() throws Exception {
604605
logger.info("--> restoring index [{}] with specific replica count", restoredIndexName);
605606
Settings.Builder indexSettingsBuilder = Settings.builder()
606607
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
607-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
608608
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, replicaCount);
609609
final MountSearchableSnapshotRequest req = new MountSearchableSnapshotRequest(
610610
restoredIndexName,
@@ -638,7 +638,6 @@ public void testMountedSnapshotHasNoReplicasByDefault() throws Exception {
638638
logger.info("--> restoring index [{}] with auto-expand replicas configured", restoredIndexName);
639639
Settings.Builder indexSettingsBuilder = Settings.builder()
640640
.put(SearchableSnapshots.SNAPSHOT_CACHE_ENABLED_SETTING.getKey(), true)
641-
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString())
642641
.put(IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS, replicaLimit == dataNodesCount ? "0-all" : "0-" + replicaLimit);
643642
final MountSearchableSnapshotRequest req = new MountSearchableSnapshotRequest(
644643
restoredIndexName,
@@ -1102,6 +1101,62 @@ public void testSnapshotOfSearchableSnapshotCanBeRestoredBeforeRepositoryRegiste
11021101
assertTotalHits(restoredIndexName, originalAllHits, originalBarHits);
11031102
}
11041103

1104+
public void testCheckOnStartupCanBeOverridden() throws Exception {
1105+
final String suffix = getTestName().toLowerCase(Locale.ROOT);
1106+
1107+
final String index = "index_" + suffix;
1108+
final Settings.Builder indexSettings = Settings.builder();
1109+
indexSettings.put(INDEX_SOFT_DELETES_SETTING.getKey(), true);
1110+
1111+
final String checkOnStartup = randomFrom("false", "true", "checksum", null);
1112+
if (checkOnStartup != null) {
1113+
indexSettings.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), checkOnStartup);
1114+
}
1115+
createAndPopulateIndex(index, indexSettings);
1116+
1117+
final String repository = "repository_" + suffix;
1118+
createRepository(repository, "fs");
1119+
1120+
final String snapshot = "snapshot_" + suffix;
1121+
createFullSnapshot(repository, snapshot);
1122+
assertAcked(client().admin().indices().prepareDelete(index));
1123+
1124+
{
1125+
final String mountedIndex = mountSnapshot(repository, snapshot, index, Settings.EMPTY);
1126+
assertThat(
1127+
client().admin()
1128+
.indices()
1129+
.prepareGetSettings(mountedIndex)
1130+
.get()
1131+
.getIndexToSettings()
1132+
.get(mountedIndex)
1133+
.get(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey()),
1134+
equalTo("false")
1135+
);
1136+
assertAcked(client().admin().indices().prepareDelete(mountedIndex));
1137+
}
1138+
{
1139+
final String overridingCheckOnStartup = randomValueOtherThan(checkOnStartup, () -> randomFrom("false", "true", "checksum"));
1140+
final String mountedIndex = mountSnapshot(
1141+
repository,
1142+
snapshot,
1143+
index,
1144+
Settings.builder().put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), overridingCheckOnStartup).build()
1145+
);
1146+
assertThat(
1147+
client().admin()
1148+
.indices()
1149+
.prepareGetSettings(mountedIndex)
1150+
.get()
1151+
.getIndexToSettings()
1152+
.get(mountedIndex)
1153+
.get(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey()),
1154+
equalTo(overridingCheckOnStartup)
1155+
);
1156+
assertAcked(client().admin().indices().prepareDelete(mountedIndex));
1157+
}
1158+
}
1159+
11051160
private void assertSearchableSnapshotStats(String indexName, boolean cacheEnabled, List<String> nonCachedExtensions) {
11061161
final SearchableSnapshotsStatsResponse statsResponse = client().execute(
11071162
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
@@ -28,6 +28,7 @@
2828
import org.elasticsearch.common.settings.Settings;
2929
import org.elasticsearch.core.List;
3030
import org.elasticsearch.index.IndexNotFoundException;
31+
import org.elasticsearch.index.IndexSettings;
3132
import org.elasticsearch.indices.ShardLimitValidator;
3233
import org.elasticsearch.indices.SystemIndices;
3334
import org.elasticsearch.license.XPackLicenseState;
@@ -230,9 +231,10 @@ protected void masterOperation(
230231
}
231232
}
232233

233-
Settings indexSettings = Settings.builder()
234+
final Settings indexSettings = Settings.builder()
234235
.put(IndexMetadata.SETTING_NUMBER_OF_REPLICAS, 0) // can be overridden
235236
.put(IndexMetadata.SETTING_AUTO_EXPAND_REPLICAS, false) // can be overridden
237+
.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), false) // can be overridden
236238
.put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, getDataTiersPreference(request.storage()))
237239
.put(request.indexSettings())
238240
.put(

0 commit comments

Comments
 (0)