Skip to content

Commit fe9f0b4

Browse files
authored
Remove processors setting (#45905)
The processors setting was deprecated in version 7.4.0 of Elasticsearch for removal in Elasticsearch 8.0.0. This commit removes the processors setting.
1 parent 153ea94 commit fe9f0b4

File tree

5 files changed

+12
-33
lines changed

5 files changed

+12
-33
lines changed

docs/reference/migration/migrate_8_0/settings.asciidoc

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,19 @@ refuse to start if you have these settings in your configuration or cluster
1313
state.
1414

1515
[float]
16-
==== `processors` can no longer exceed the available number of processors
16+
[[remove-processors]]
17+
==== `processors` setting is replaced by `node.processors`
18+
19+
To ensure that all settings are in a proper namespace, the `processors` setting
20+
was previously deprecated in version 7.4.0 of Elasticsearch, and is removed in
21+
version 8.0.0. Instead, use `node.processors`.
22+
23+
[float]
24+
==== `node.processors` can no longer exceed the available number of processors
1725

1826
Previously it was possible to set the number of processors used to set the
1927
default sizes for the thread pools to be more than the number of available
2028
processors. As this leads to more context switches and more threads but without
2129
an increase in the number of physical CPUs on which to schedule these additional
22-
threads, the `processors` setting is now bounded by the number of available
30+
threads, the `node.processors` setting is now bounded by the number of available
2331
processors.

server/src/main/java/org/elasticsearch/common/settings/ClusterSettings.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ public void apply(Settings value, Settings current, Settings previous) {
389389
ClusterName.CLUSTER_NAME_SETTING,
390390
Client.CLIENT_TYPE_SETTING_S,
391391
ClusterModule.SHARDS_ALLOCATOR_TYPE_SETTING,
392-
EsExecutors.PROCESSORS_SETTING,
393392
EsExecutors.NODE_PROCESSORS_SETTING,
394393
ThreadContext.DEFAULT_HEADERS_SETTING,
395394
Loggers.LOG_DEFAULT_LEVEL_SETTING,

server/src/main/java/org/elasticsearch/common/settings/Setting.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1053,15 +1053,6 @@ public static Setting<Integer> intSetting(String key, Setting<Integer> fallbackS
10531053
return new Setting<>(key, fallbackSetting, (s) -> parseInt(s, minValue, key), properties);
10541054
}
10551055

1056-
public static Setting<Integer> intSetting(
1057-
final String key,
1058-
final Setting<Integer> fallbackSetting,
1059-
final int minValue,
1060-
final int maxValue,
1061-
final Property... properties) {
1062-
return new Setting<>(key, fallbackSetting, (s) -> parseInt(s, minValue, maxValue, key), properties);
1063-
}
1064-
10651056
public static Setting<Integer> intSetting(String key, Setting<Integer> fallbackSetting, int minValue, Validator<Integer> validator,
10661057
Property... properties) {
10671058
return new Setting<>(new SimpleKey(key), fallbackSetting, fallbackSetting::getRaw, (s) -> parseInt(s, minValue, key),validator,

server/src/main/java/org/elasticsearch/common/util/concurrent/EsExecutors.java

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,12 @@
4646

4747
public class EsExecutors {
4848

49-
public static final Setting<Integer> PROCESSORS_SETTING = Setting.intSetting(
50-
"processors",
51-
Runtime.getRuntime().availableProcessors(),
52-
1,
53-
Runtime.getRuntime().availableProcessors(),
54-
Property.Deprecated,
55-
Property.NodeScope);
56-
5749
/**
5850
* Setting to manually set the number of available processors. This setting is used to adjust thread pool sizes per node.
5951
*/
60-
// TODO: when removing "processors" setting, the default value is Runtime.getRuntime().availableProcessors()
6152
public static final Setting<Integer> NODE_PROCESSORS_SETTING = Setting.intSetting(
6253
"node.processors",
63-
PROCESSORS_SETTING,
54+
Runtime.getRuntime().availableProcessors(),
6455
1,
6556
Runtime.getRuntime().availableProcessors(),
6657
Property.NodeScope);

server/src/test/java/org/elasticsearch/common/util/concurrent/EsExecutorsTests.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -392,14 +392,7 @@ public void testGetTasks() throws InterruptedException {
392392
}
393393

394394
public void testNodeProcessorsBound() {
395-
runProcessorsBoundTest(EsExecutors.NODE_PROCESSORS_SETTING);
396-
}
397-
398-
public void testProcessorsBound() {
399-
runProcessorsBoundTest(EsExecutors.PROCESSORS_SETTING);
400-
}
401-
402-
private void runProcessorsBoundTest(final Setting<Integer> processorsSetting) {
395+
final Setting<Integer> processorsSetting = EsExecutors.NODE_PROCESSORS_SETTING;
403396
final int available = Runtime.getRuntime().availableProcessors();
404397
final int processors = randomIntBetween(available + 1, Integer.MAX_VALUE);
405398
final Settings settings = Settings.builder().put(processorsSetting.getKey(), processors).build();
@@ -412,9 +405,6 @@ private void runProcessorsBoundTest(final Setting<Integer> processorsSetting) {
412405
processorsSetting.getKey(),
413406
available);
414407
assertThat(e, hasToString(containsString(expected)));
415-
if (processorsSetting.getProperties().contains(Setting.Property.Deprecated)) {
416-
assertSettingDeprecationsAndWarnings(new Setting<?>[]{processorsSetting});
417-
}
418408
}
419409

420410
}

0 commit comments

Comments
 (0)