Skip to content

Commit 20b432f

Browse files
authored
[8.x] Downgrade cluster.routing.allocation.type deprecation to a warning (#124785)
This setting is not getting removed in ES 9.0, so its usage should not generate a critical deprecation warning. See ES-11224
1 parent cf30552 commit 20b432f

File tree

7 files changed

+9
-9
lines changed

7 files changed

+9
-9
lines changed

server/src/main/java/org/elasticsearch/cluster/ClusterModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public class ClusterModule extends AbstractModule {
109109
DESIRED_BALANCE_ALLOCATOR,
110110
Function.identity(),
111111
Property.NodeScope,
112-
Property.Deprecated
112+
Property.DeprecatedWarning
113113
);
114114

115115
private final ClusterService clusterService;

server/src/test/java/org/elasticsearch/cluster/ClusterModuleTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public void testRegisterShardsAllocator() {
188188
Settings settings = Settings.builder().put(ClusterModule.SHARDS_ALLOCATOR_TYPE_SETTING.getKey(), "custom").build();
189189
ClusterModule module = newClusterModuleWithShardsAllocator(settings, "custom", FakeShardsAllocator::new);
190190
assertEquals(FakeShardsAllocator.class, module.shardsAllocator.getClass());
191-
assertCriticalWarnings(
191+
assertWarnings(
192192
"[cluster.routing.allocation.type] setting was deprecated in Elasticsearch and will be removed in a future release."
193193
);
194194
}
@@ -218,15 +218,15 @@ public void testUnknownShardsAllocator() {
218218
)
219219
);
220220
assertEquals("Unknown ShardsAllocator [dne]", e.getMessage());
221-
assertCriticalWarnings(
221+
assertWarnings(
222222
"[cluster.routing.allocation.type] setting was deprecated in Elasticsearch and will be removed in a future release."
223223
);
224224
}
225225

226226
public void testShardsAllocatorFactoryNull() {
227227
Settings settings = Settings.builder().put(ClusterModule.SHARDS_ALLOCATOR_TYPE_SETTING.getKey(), "bad").build();
228228
expectThrows(NullPointerException.class, () -> newClusterModuleWithShardsAllocator(settings, "bad", () -> null));
229-
assertCriticalWarnings(
229+
assertWarnings(
230230
"[cluster.routing.allocation.type] setting was deprecated in Elasticsearch and will be removed in a future release."
231231
);
232232
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ public void beforeAllocation(RoutingAllocation allocation) {
703703
}
704704
}
705705
);
706-
assertCriticalWarnings(
706+
assertWarnings(
707707
"[cluster.routing.allocation.type] setting was deprecated in Elasticsearch and will be removed in a future release."
708708
);
709709

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ public void testRebalanceShouldNotPerformUnnecessaryMovesWithMultipleConcurrentR
448448
.build();
449449

450450
final var allocationService = createAllocationService(settings);
451-
assertCriticalWarnings(
451+
assertWarnings(
452452
"[cluster.routing.allocation.type] setting was deprecated in Elasticsearch and will be removed in a future release."
453453
);
454454

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public void testThrottleIncomingAndOutgoing() {
199199
EmptyClusterInfoService.INSTANCE,
200200
snapshotsInfoService
201201
);
202-
assertCriticalWarnings(
202+
assertWarnings(
203203
"[cluster.routing.allocation.type] setting was deprecated in Elasticsearch and will be removed in a future release."
204204
);
205205
logger.info("Building initial routing table");

server/src/test/java/org/elasticsearch/snapshots/InternalSnapshotsInfoServiceTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ public IndexShardSnapshotStatus.Copy getShardSnapshotStatus(SnapshotId snapshotI
361361
.build(),
362362
snapshotsInfoService
363363
);
364-
assertCriticalWarnings(
364+
assertWarnings(
365365
"[cluster.routing.allocation.type] setting was deprecated in Elasticsearch and will be removed in a future release."
366366
);
367367
applyClusterState(

server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2204,7 +2204,7 @@ public RecyclerBytesStreamOutput newNetworkBytesStream() {
22042204
.build(),
22052205
snapshotsInfoService
22062206
);
2207-
assertCriticalWarnings(
2207+
assertWarnings(
22082208
"[cluster.routing.allocation.type] setting was deprecated in Elasticsearch and will be removed in a future release."
22092209
);
22102210
rerouteService = new BatchedRerouteService(clusterService, allocationService::reroute);

0 commit comments

Comments
 (0)