Skip to content

Commit 49dcc16

Browse files
authored
Remove unsupported LEGACY_MULTI_NODE_DISCOVERY_TYPE (#112903)
This was never documented as supported anyway and has been deprecated for several years so can now be removed.
1 parent 3a88358 commit 49dcc16

File tree

3 files changed

+18
-40
lines changed

3 files changed

+18
-40
lines changed

docs/changelog/112903.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
pr: 112903
2+
summary: Remove unsupported legacy value for `discovery.type`
3+
area: Cluster Coordination
4+
type: breaking
5+
issues: []
6+
breaking:
7+
title: Remove unsupported legacy value for `discovery.type`
8+
area: Cluster and node setting
9+
details: >-
10+
Earlier versions of {es} had a `discovery.type` setting which permitted
11+
values that referred to legacy discovery types. From v9.0.0 onwards, the
12+
only supported values for this setting are `multi-node` (the default) and
13+
`single-node`.
14+
impact: >-
15+
Remove any value for `discovery.type` from your `elasticsearch.yml`
16+
configuration file.
17+
notable: false

server/src/main/java/org/elasticsearch/discovery/DiscoveryModule.java

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,12 @@
2727
import org.elasticsearch.cluster.version.CompatibilityVersions;
2828
import org.elasticsearch.common.Randomness;
2929
import org.elasticsearch.common.io.stream.NamedWriteableRegistry;
30-
import org.elasticsearch.common.logging.DeprecationCategory;
31-
import org.elasticsearch.common.logging.DeprecationLogger;
3230
import org.elasticsearch.common.network.NetworkService;
3331
import org.elasticsearch.common.settings.ClusterSettings;
3432
import org.elasticsearch.common.settings.Setting;
3533
import org.elasticsearch.common.settings.Setting.Property;
3634
import org.elasticsearch.common.settings.Settings;
3735
import org.elasticsearch.common.transport.TransportAddress;
38-
import org.elasticsearch.core.UpdateForV9;
3936
import org.elasticsearch.features.FeatureService;
4037
import org.elasticsearch.gateway.GatewayMetaState;
4138
import org.elasticsearch.indices.breaker.CircuitBreakerService;
@@ -70,8 +67,6 @@ public class DiscoveryModule extends AbstractModule {
7067

7168
public static final String MULTI_NODE_DISCOVERY_TYPE = "multi-node";
7269
public static final String SINGLE_NODE_DISCOVERY_TYPE = "single-node";
73-
@Deprecated
74-
public static final String LEGACY_MULTI_NODE_DISCOVERY_TYPE = "zen";
7570

7671
public static final Setting<String> DISCOVERY_TYPE_SETTING = new Setting<>(
7772
"discovery.type",
@@ -175,15 +170,11 @@ public DiscoveryModule(
175170
throw new IllegalArgumentException("Unknown election strategy " + ELECTION_STRATEGY_SETTING.get(settings));
176171
}
177172

178-
checkLegacyMultiNodeDiscoveryType(discoveryType);
179-
180173
this.reconfigurator = getReconfigurator(settings, clusterSettings, clusterCoordinationPlugins);
181174
var preVoteCollectorFactory = getPreVoteCollectorFactory(clusterCoordinationPlugins);
182175
var leaderHeartbeatService = getLeaderHeartbeatService(settings, clusterCoordinationPlugins);
183176

184-
if (MULTI_NODE_DISCOVERY_TYPE.equals(discoveryType)
185-
|| LEGACY_MULTI_NODE_DISCOVERY_TYPE.equals(discoveryType)
186-
|| SINGLE_NODE_DISCOVERY_TYPE.equals(discoveryType)) {
177+
if (MULTI_NODE_DISCOVERY_TYPE.equals(discoveryType) || SINGLE_NODE_DISCOVERY_TYPE.equals(discoveryType)) {
187178
coordinator = new Coordinator(
188179
NODE_NAME_SETTING.get(settings),
189180
settings,
@@ -215,22 +206,6 @@ public DiscoveryModule(
215206
logger.info("using discovery type [{}] and seed hosts providers {}", discoveryType, seedProviderNames);
216207
}
217208

218-
@UpdateForV9
219-
private static void checkLegacyMultiNodeDiscoveryType(String discoveryType) {
220-
if (LEGACY_MULTI_NODE_DISCOVERY_TYPE.equals(discoveryType)) {
221-
DeprecationLogger.getLogger(DiscoveryModule.class)
222-
.critical(
223-
DeprecationCategory.SETTINGS,
224-
"legacy-discovery-type",
225-
"Support for setting [{}] to [{}] is deprecated and will be removed in a future version. Set this setting to [{}] "
226-
+ "instead.",
227-
DISCOVERY_TYPE_SETTING.getKey(),
228-
LEGACY_MULTI_NODE_DISCOVERY_TYPE,
229-
MULTI_NODE_DISCOVERY_TYPE
230-
);
231-
}
232-
}
233-
234209
// visible for testing
235210
static Reconfigurator getReconfigurator(
236211
Settings settings,

server/src/test/java/org/elasticsearch/discovery/DiscoveryModuleTests.java

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -219,20 +219,6 @@ public BiConsumer<DiscoveryNode, ClusterState> getJoinValidator() {
219219
assertTrue(onJoinValidators.contains(consumer));
220220
}
221221

222-
public void testLegacyDiscoveryType() {
223-
newModule(
224-
Settings.builder()
225-
.put(DiscoveryModule.DISCOVERY_TYPE_SETTING.getKey(), DiscoveryModule.LEGACY_MULTI_NODE_DISCOVERY_TYPE)
226-
.build(),
227-
List.of(),
228-
List.of()
229-
);
230-
assertCriticalWarnings(
231-
"Support for setting [discovery.type] to [zen] is deprecated and will be removed in a future version. Set this setting to "
232-
+ "[multi-node] instead."
233-
);
234-
}
235-
236222
public void testRejectsMultipleReconfigurators() {
237223
assertThat(
238224
expectThrows(

0 commit comments

Comments
 (0)