Skip to content

Commit 0853924

Browse files
committed
Deprecate include_relocations setting
Setting `cluster.routing.allocation.disk.include_relocations` to `false` is a bad idea since it will lead to the kinds of overshoot that were otherwise fixed in elastic#46079. This commit deprecates this setting so it can be removed in the next major release.
1 parent fcf6c17 commit 0853924

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

docs/reference/modules/cluster/disk_allocator.asciidoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ PUT /twitter/_settings
6969

7070
`cluster.routing.allocation.disk.include_relocations`::
7171

72+
deprecated[7.5] Future versions will always account for relocations.
7273
Defaults to +true+, which means that Elasticsearch will take into account
7374
shards that are currently being relocated to the target node when computing
7475
a node's disk usage. Taking relocating shards' sizes into account may,

server/src/main/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class DiskThresholdSettings {
5757
Setting.Property.Dynamic, Setting.Property.NodeScope);
5858
public static final Setting<Boolean> CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING =
5959
Setting.boolSetting("cluster.routing.allocation.disk.include_relocations", true,
60-
Setting.Property.Dynamic, Setting.Property.NodeScope);
60+
Setting.Property.Dynamic, Setting.Property.NodeScope, Setting.Property.Deprecated);
6161
public static final Setting<TimeValue> CLUSTER_ROUTING_ALLOCATION_REROUTE_INTERVAL_SETTING =
6262
Setting.positiveTimeSetting("cluster.routing.allocation.disk.reroute_interval", TimeValue.timeValueSeconds(60),
6363
Setting.Property.Dynamic, Setting.Property.NodeScope);

server/src/test/java/org/elasticsearch/cluster/routing/allocation/DiskThresholdSettingsTests.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ public void testUpdate() {
7272
assertEquals(30L, diskThresholdSettings.getRerouteInterval().seconds());
7373
assertFalse(diskThresholdSettings.isEnabled());
7474
assertFalse(diskThresholdSettings.includeRelocations());
75+
76+
assertWarnings("[cluster.routing.allocation.disk.include_relocations] setting was deprecated in Elasticsearch and " +
77+
"will be removed in a future release! See the breaking changes documentation for the next major version.");
7578
}
7679

7780
public void testInvalidConstruction() {

0 commit comments

Comments
 (0)