Skip to content

Commit b6168e2

Browse files
authored
ILM mount snapshot step does need to set index.shard.check_on_startup (elastic#74283)
Now the Mount API overrides the index.shard.check_on_startup setting value to false, there's no need for MountSnapshotStep to set it explicitly. Relates elastic#74235 This commit also fixes a failing test where some leftover code was overriding the setting value. Closes elastic#74282
1 parent 1434d87 commit b6168e2

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ilm/MountSnapshotStep.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import org.elasticsearch.common.Strings;
1717
import org.elasticsearch.common.settings.Settings;
1818
import org.elasticsearch.core.TimeValue;
19-
import org.elasticsearch.index.IndexSettings;
2019
import org.elasticsearch.rest.RestStatus;
2120
import org.elasticsearch.xpack.cluster.routing.allocation.DataTierAllocationDecider;
2221
import org.elasticsearch.xpack.core.DataTier;
@@ -104,8 +103,7 @@ void performDuringNoSnapshot(IndexMetadata indexMetadata, ClusterState currentCl
104103
indexName = snapshotIndexName;
105104
}
106105

107-
Settings.Builder settingsBuilder = Settings.builder();
108-
settingsBuilder.put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), Boolean.FALSE.toString());
106+
final Settings.Builder settingsBuilder = Settings.builder();
109107
// if we are mounting a searchable snapshot in the hot phase, then the index should be pinned to the hot nodes
110108
if (TimeseriesLifecycleType.HOT_PHASE.equals(this.getKey().getPhase())) {
111109
settingsBuilder.put(DataTierAllocationDecider.INDEX_ROUTING_PREFER, DataTier.DATA_HOT);

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171

7272
public class FrozenSearchableSnapshotsIntegTests extends BaseFrozenSearchableSnapshotsIntegTestCase {
7373

74-
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/74282")
7574
public void testCreateAndRestorePartialSearchableSnapshot() throws Exception {
7675
final String fsRepoName = randomAlphaOfLength(10);
7776
final String indexName = randomAlphaOfLength(10).toLowerCase(Locale.ROOT);
@@ -292,7 +291,7 @@ public void testCreateAndRestorePartialSearchableSnapshot() throws Exception {
292291
assertThat(DataTierAllocationDecider.INDEX_ROUTING_PREFER_SETTING.get(settings), equalTo(expectedDataTiersPreference));
293292
assertTrue(SearchableSnapshotsConstants.SNAPSHOT_PARTIAL_SETTING.get(settings));
294293
assertTrue(DiskThresholdDecider.SETTING_IGNORE_DISK_WATERMARKS.get(settings));
295-
assertThat(IndexSettings.INDEX_CHECK_ON_STARTUP.get(settings), equalTo("false"));
294+
assertThat(IndexSettings.INDEX_CHECK_ON_STARTUP.get(settings), equalTo(indexCheckOnStartup));
296295

297296
checkSoftDeletesNotEagerlyLoaded(restoredIndexName);
298297
assertTotalHits(restoredIndexName, originalAllHits, originalBarHits);

0 commit comments

Comments
 (0)