Skip to content

Commit 00b272a

Browse files
author
Vladimir Dolzhenko
committed
completely drop index.shard.check_on_startup: fix for 7.0 (#33194)
Relates to #32279
1 parent 6a77cb4 commit 00b272a

File tree

6 files changed

+6
-21
lines changed

6 files changed

+6
-21
lines changed

docs/reference/index-modules.asciidoc

-4
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ corruption is detected, it will prevent the shard from being opened. Accepts:
6363
Check for both physical and logical corruption. This is much more
6464
expensive in terms of CPU and memory usage.
6565

66-
`fix`::
67-
68-
The same as `false`. This option is deprecated and will be completely removed in 7.0.
69-
7066
WARNING: Expert only. Checking shards may take a lot of time on large indices.
7167
--
7268

docs/reference/migration/migrate_7_0/indices.asciidoc

+4
Original file line numberDiff line numberDiff line change
@@ -78,3 +78,7 @@ The parent circuit breaker defines a new setting `indices.breaker.total.use_real
7878
heap memory instead of only considering the reserved memory by child circuit breakers. When this
7979
setting is `true`, the default parent breaker limit also changes from 70% to 95% of the JVM heap size.
8080
The previous behavior can be restored by setting `indices.breaker.total.use_real_memory` to `false`.
81+
82+
==== `fix` value for `index.shard.check_on_startup` is removed
83+
84+
Deprecated option value `fix` for setting `index.shard.check_on_startup` is not supported.

server/src/main/java/org/elasticsearch/index/IndexSettings.java

+1-2
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,10 @@ public final class IndexSettings {
7575
switch(s) {
7676
case "false":
7777
case "true":
78-
case "fix":
7978
case "checksum":
8079
return s;
8180
default:
82-
throw new IllegalArgumentException("unknown value for [index.shard.check_on_startup] must be one of [true, false, fix, checksum] but was: " + s);
81+
throw new IllegalArgumentException("unknown value for [index.shard.check_on_startup] must be one of [true, false, checksum] but was: " + s);
8382
}
8483
}, Property.IndexScope);
8584

server/src/main/java/org/elasticsearch/index/shard/IndexShard.java

-4
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,6 @@ public IndexShard(
301301
logger.debug("state: [CREATED]");
302302

303303
this.checkIndexOnStartup = indexSettings.getValue(IndexSettings.INDEX_CHECK_ON_STARTUP);
304-
if ("fix".equals(checkIndexOnStartup)) {
305-
deprecationLogger.deprecated("Setting [index.shard.check_on_startup] is set to deprecated value [fix], "
306-
+ "which has no effect and will not be accepted in future");
307-
}
308304
this.translogConfig = new TranslogConfig(shardId, shardPath().resolveTranslog(), indexSettings, bigArrays);
309305
final String aId = shardRouting.allocationId().getId();
310306
this.globalCheckpointListeners = new GlobalCheckpointListeners(shardId, threadPool.executor(ThreadPool.Names.LISTENER), logger);

server/src/test/java/org/elasticsearch/action/admin/indices/template/put/MetaDataIndexTemplateServiceTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public void testIndexTemplateInvalidNumberOfShards() {
6969
containsString("Failed to parse value [0] for setting [index.number_of_shards] must be >= 1"));
7070
assertThat(throwables.get(0).getMessage(),
7171
containsString("unknown value for [index.shard.check_on_startup] " +
72-
"must be one of [true, false, fix, checksum] but was: blargh"));
72+
"must be one of [true, false, checksum] but was: blargh"));
7373
}
7474

7575
public void testIndexTemplateValidationAccumulatesValidationErrors() {

server/src/test/java/org/elasticsearch/index/shard/IndexShardTests.java

-10
Original file line numberDiff line numberDiff line change
@@ -2798,16 +2798,6 @@ public void testReadSnapshotAndCheckIndexConcurrently() throws Exception {
27982798
closeShards(newShard);
27992799
}
28002800

2801-
public void testCheckOnStartupDeprecatedValue() throws Exception {
2802-
final Settings settings = Settings.builder().put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), "fix").build();
2803-
2804-
final IndexShard newShard = newShard(true, settings);
2805-
closeShards(newShard);
2806-
2807-
assertWarnings("Setting [index.shard.check_on_startup] is set to deprecated value [fix], "
2808-
+ "which has no effect and will not be accepted in future");
2809-
}
2810-
28112801
class Result {
28122802
private final int localCheckpoint;
28132803
private final int maxSeqNo;

0 commit comments

Comments
 (0)