Skip to content

Commit bb5f750

Browse files
committed
Deprecate include_relocations setting (#47443)
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 #46079. This commit deprecates this setting so it can be removed in the next major release.
1 parent 5e0e54f commit bb5f750

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

docs/reference/modules/cluster/disk_allocator.asciidoc

+1
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

+1-1
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

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

7881
public void testInvalidConstruction() {

server/src/test/java/org/elasticsearch/cluster/routing/allocation/decider/DiskThresholdDeciderTests.java

-3
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,6 @@ public void testFreeDiskPercentageAfterShardAssigned() {
635635
public void testShardRelocationsTakenIntoAccount() {
636636
Settings diskSettings = Settings.builder()
637637
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING.getKey(), true)
638-
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING.getKey(), true)
639638
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), 0.7)
640639
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey(), 0.8).build();
641640

@@ -732,7 +731,6 @@ Settings.EMPTY, new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLU
732731
public void testCanRemainWithShardRelocatingAway() {
733732
Settings diskSettings = Settings.builder()
734733
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING.getKey(), true)
735-
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING.getKey(), true)
736734
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), "60%")
737735
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey(), "70%").build();
738736

@@ -862,7 +860,6 @@ Settings.EMPTY, new ClusterSettings(Settings.EMPTY, ClusterSettings.BUILT_IN_CLU
862860
public void testForSingleDataNode() {
863861
Settings diskSettings = Settings.builder()
864862
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_DISK_THRESHOLD_ENABLED_SETTING.getKey(), true)
865-
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_INCLUDE_RELOCATIONS_SETTING.getKey(), true)
866863
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_LOW_DISK_WATERMARK_SETTING.getKey(), "60%")
867864
.put(DiskThresholdSettings.CLUSTER_ROUTING_ALLOCATION_HIGH_DISK_WATERMARK_SETTING.getKey(), "70%").build();
868865

0 commit comments

Comments
 (0)