Skip to content

Commit 1b0c728

Browse files
authored
Remove deprecated search.remote settings (#42381)
We deprecated these settings awhile ago, in favor of cluster.remote. In 7.x we were gentle and provided automatic upgrade of these settings to the new settings. Now it is time for them to go. This commit removes the deprecated search.remote settings.
1 parent 733e589 commit 1b0c728

File tree

10 files changed

+26
-355
lines changed

10 files changed

+26
-355
lines changed

docs/reference/migration/migrate_8_0.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ coming[8.0.0]
2424
* <<breaking_80_transport_changes>>
2525
* <<breaking_80_http_changes>>
2626
* <<breaking_80_reindex_changes>>
27+
* <<breaking_80_settings_changes>>
2728

2829
//NOTE: The notable-breaking-changes tagged regions are re-used in the
2930
//Installation and Upgrade Guide
@@ -59,3 +60,4 @@ include::migrate_8_0/node.asciidoc[]
5960
include::migrate_8_0/transport.asciidoc[]
6061
include::migrate_8_0/http.asciidoc[]
6162
include::migrate_8_0/reindex.asciidoc[]
63+
include::migrate_8_0/settings.asciidoc[]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
[float]
2+
[[breaking_80_settings_changes]]
3+
=== Settings changes
4+
5+
[float]
6+
[[search-remote-settings-removed]]
7+
==== The `search.remote` settings have been removed
8+
9+
In 6.5 these settings were deprecated in favor of `cluster.remote`. In 7.x we
10+
provided automatic upgrading of these settings to their `cluster.remote`
11+
counterparts. In 8.0.0, these settings have been removed. Elasticsearch will
12+
refuse to start if you have these settings in your configuration or cluster
13+
state.

qa/full-cluster-restart/src/test/java/org/elasticsearch/upgrades/FullClusterRestartSettingsUpgradeIT.java

Lines changed: 0 additions & 24 deletions
This file was deleted.

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

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -280,19 +280,12 @@ public void apply(Settings value, Settings current, Settings previous) {
280280
SearchService.DEFAULT_ALLOW_PARTIAL_SEARCH_RESULTS,
281281
TransportSearchAction.SHARD_COUNT_LIMIT_SETTING,
282282
RemoteClusterAware.REMOTE_CLUSTERS_SEEDS,
283-
RemoteClusterAware.SEARCH_REMOTE_CLUSTERS_SEEDS,
284283
RemoteClusterAware.REMOTE_CLUSTERS_PROXY,
285-
RemoteClusterAware.SEARCH_REMOTE_CLUSTERS_PROXY,
286284
RemoteClusterService.REMOTE_CLUSTER_SKIP_UNAVAILABLE,
287-
RemoteClusterService.SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE,
288285
RemoteClusterService.REMOTE_CONNECTIONS_PER_CLUSTER,
289-
RemoteClusterService.SEARCH_REMOTE_CONNECTIONS_PER_CLUSTER,
290286
RemoteClusterService.REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING,
291-
RemoteClusterService.SEARCH_REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING,
292287
RemoteClusterService.REMOTE_NODE_ATTRIBUTE,
293-
RemoteClusterService.SEARCH_REMOTE_NODE_ATTRIBUTE,
294288
RemoteClusterService.ENABLE_REMOTE_CLUSTERS,
295-
RemoteClusterService.SEARCH_ENABLE_REMOTE_CLUSTERS,
296289
RemoteClusterService.REMOTE_CLUSTER_PING_SCHEDULE,
297290
RemoteClusterService.REMOTE_CLUSTER_COMPRESS,
298291
TransportCloseIndexAction.CLUSTER_INDICES_CLOSE_ENABLE_SETTING,
@@ -451,9 +444,6 @@ public void apply(Settings value, Settings current, Settings previous) {
451444
ClusterBootstrapService.UNCONFIGURED_BOOTSTRAP_TIMEOUT_SETTING,
452445
LagDetector.CLUSTER_FOLLOWER_LAG_TIMEOUT_SETTING);
453446

454-
static List<SettingUpgrader<?>> BUILT_IN_SETTING_UPGRADERS = List.of(
455-
RemoteClusterAware.SEARCH_REMOTE_CLUSTER_SEEDS_UPGRADER,
456-
RemoteClusterAware.SEARCH_REMOTE_CLUSTERS_PROXY_UPGRADER,
457-
RemoteClusterService.SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE_UPGRADER);
447+
static List<SettingUpgrader<?>> BUILT_IN_SETTING_UPGRADERS = Collections.emptyList();
458448

459449
}

server/src/main/java/org/elasticsearch/transport/RemoteClusterAware.java

Lines changed: 3 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import org.elasticsearch.common.collect.Tuple;
2828
import org.elasticsearch.common.settings.ClusterSettings;
2929
import org.elasticsearch.common.settings.Setting;
30-
import org.elasticsearch.common.settings.SettingUpgrader;
3130
import org.elasticsearch.common.settings.Settings;
3231
import org.elasticsearch.common.transport.TransportAddress;
3332
import org.elasticsearch.common.unit.TimeValue;
@@ -41,11 +40,8 @@
4140
import java.util.EnumSet;
4241
import java.util.HashMap;
4342
import java.util.List;
44-
import java.util.Locale;
4543
import java.util.Map;
46-
import java.util.NavigableSet;
4744
import java.util.Set;
48-
import java.util.TreeSet;
4945
import java.util.function.Supplier;
5046
import java.util.stream.Collectors;
5147
import java.util.stream.Stream;
@@ -55,41 +51,6 @@
5551
*/
5652
public abstract class RemoteClusterAware {
5753

58-
static {
59-
// remove search.remote.* settings in 8.0.0
60-
// TODO https://github.com/elastic/elasticsearch/issues/38556
61-
// assert Version.CURRENT.major < 8;
62-
}
63-
64-
public static final Setting.AffixSetting<List<String>> SEARCH_REMOTE_CLUSTERS_SEEDS =
65-
Setting.affixKeySetting(
66-
"search.remote.",
67-
"seeds",
68-
key -> Setting.listSetting(
69-
key,
70-
Collections.emptyList(),
71-
s -> {
72-
parsePort(s);
73-
return s;
74-
},
75-
Setting.Property.Deprecated,
76-
Setting.Property.Dynamic,
77-
Setting.Property.NodeScope));
78-
79-
public static final SettingUpgrader<List<String>> SEARCH_REMOTE_CLUSTER_SEEDS_UPGRADER = new SettingUpgrader<List<String>>() {
80-
81-
@Override
82-
public Setting<List<String>> getSetting() {
83-
return SEARCH_REMOTE_CLUSTERS_SEEDS;
84-
}
85-
86-
@Override
87-
public String getKey(final String key) {
88-
return key.replaceFirst("^search", "cluster");
89-
}
90-
91-
};
92-
9354
/**
9455
* A list of initial seed nodes to discover eligible nodes from the remote cluster
9556
*/
@@ -98,10 +59,7 @@ public String getKey(final String key) {
9859
"seeds",
9960
key -> Setting.listSetting(
10061
key,
101-
// the default needs to be emptyList() when fallback is removed
102-
"_na_".equals(key)
103-
? SEARCH_REMOTE_CLUSTERS_SEEDS.getConcreteSettingForNamespace(key)
104-
: SEARCH_REMOTE_CLUSTERS_SEEDS.getConcreteSetting(key.replaceAll("^cluster", "search")),
62+
Collections.emptyList(),
10563
s -> {
10664
// validate seed address
10765
parsePort(s);
@@ -113,35 +71,6 @@ public String getKey(final String key) {
11371
public static final char REMOTE_CLUSTER_INDEX_SEPARATOR = ':';
11472
public static final String LOCAL_CLUSTER_GROUP_KEY = "";
11573

116-
public static final Setting.AffixSetting<String> SEARCH_REMOTE_CLUSTERS_PROXY = Setting.affixKeySetting(
117-
"search.remote.",
118-
"proxy",
119-
key -> Setting.simpleString(
120-
key,
121-
s -> {
122-
if (Strings.hasLength(s)) {
123-
parsePort(s);
124-
}
125-
},
126-
Setting.Property.Deprecated,
127-
Setting.Property.Dynamic,
128-
Setting.Property.NodeScope),
129-
REMOTE_CLUSTERS_SEEDS);
130-
131-
public static final SettingUpgrader<String> SEARCH_REMOTE_CLUSTERS_PROXY_UPGRADER = new SettingUpgrader<String>() {
132-
133-
@Override
134-
public Setting<String> getSetting() {
135-
return SEARCH_REMOTE_CLUSTERS_PROXY;
136-
}
137-
138-
@Override
139-
public String getKey(final String key) {
140-
return key.replaceFirst("^search", "cluster");
141-
}
142-
143-
};
144-
14574
/**
14675
* A proxy address for the remote cluster.
14776
*/
@@ -150,15 +79,10 @@ public String getKey(final String key) {
15079
"proxy",
15180
key -> Setting.simpleString(
15281
key,
153-
// no default is needed when fallback is removed, use simple string which gives empty
154-
"_na_".equals(key)
155-
? SEARCH_REMOTE_CLUSTERS_PROXY.getConcreteSettingForNamespace(key)
156-
: SEARCH_REMOTE_CLUSTERS_PROXY.getConcreteSetting(key.replaceAll("^cluster", "search")),
15782
s -> {
15883
if (Strings.hasLength(s)) {
15984
parsePort(s);
16085
}
161-
return s;
16286
},
16387
Setting.Property.Dynamic,
16488
Setting.Property.NodeScope),
@@ -185,22 +109,8 @@ protected static Map<String, Tuple<String, List<Tuple<String, Supplier<Discovery
185109
final Settings settings) {
186110
final Map<String, Tuple<String, List<Tuple<String, Supplier<DiscoveryNode>>>>> remoteSeeds =
187111
buildRemoteClustersDynamicConfig(settings, REMOTE_CLUSTERS_SEEDS);
188-
final Map<String, Tuple<String, List<Tuple<String, Supplier<DiscoveryNode>>>>> searchRemoteSeeds =
189-
buildRemoteClustersDynamicConfig(settings, SEARCH_REMOTE_CLUSTERS_SEEDS);
190-
// sort the intersection for predictable output order
191-
final NavigableSet<String> intersection =
192-
new TreeSet<>(Arrays.asList(
193-
searchRemoteSeeds.keySet().stream().filter(s -> remoteSeeds.keySet().contains(s)).sorted().toArray(String[]::new)));
194-
if (intersection.isEmpty() == false) {
195-
final String message = String.format(
196-
Locale.ROOT,
197-
"found duplicate remote cluster configurations for cluster alias%s [%s]",
198-
intersection.size() == 1 ? "" : "es",
199-
String.join(",", intersection));
200-
throw new IllegalArgumentException(message);
201-
}
202-
return Stream
203-
.concat(remoteSeeds.entrySet().stream(), searchRemoteSeeds.entrySet().stream())
112+
return remoteSeeds.entrySet()
113+
.stream()
204114
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue));
205115
}
206116

@@ -296,11 +206,6 @@ public void listenForUpdates(ClusterSettings clusterSettings) {
296206
RemoteClusterAware.REMOTE_CLUSTERS_SEEDS, RemoteClusterService.REMOTE_CLUSTER_COMPRESS,
297207
RemoteClusterService.REMOTE_CLUSTER_PING_SCHEDULE);
298208
clusterSettings.addAffixGroupUpdateConsumer(remoteClusterSettings, this::updateRemoteCluster);
299-
clusterSettings.addAffixUpdateConsumer(
300-
RemoteClusterAware.SEARCH_REMOTE_CLUSTERS_PROXY,
301-
RemoteClusterAware.SEARCH_REMOTE_CLUSTERS_SEEDS,
302-
(key, value) -> updateRemoteCluster(key, value.v2(), value.v1()),
303-
(namespace, value) -> {});
304209
}
305210

306211
static InetSocketAddress parseSeedAddress(String remoteHost) {

server/src/main/java/org/elasticsearch/transport/RemoteClusterService.java

Lines changed: 5 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
import org.elasticsearch.common.collect.Tuple;
3434
import org.elasticsearch.common.settings.ClusterSettings;
3535
import org.elasticsearch.common.settings.Setting;
36-
import org.elasticsearch.common.settings.SettingUpgrader;
3736
import org.elasticsearch.common.settings.Settings;
3837
import org.elasticsearch.common.unit.TimeValue;
3938
import org.elasticsearch.common.util.concurrent.CountDown;
@@ -70,60 +69,34 @@ public final class RemoteClusterService extends RemoteClusterAware implements Cl
7069

7170
private static final ActionListener<Void> noopListener = ActionListener.wrap((x) -> {}, (x) -> {});
7271

73-
static {
74-
// remove search.remote.* settings in 8.0.0
75-
// TODO
76-
// assert Version.CURRENT.major < 8;
77-
}
78-
79-
public static final Setting<Integer> SEARCH_REMOTE_CONNECTIONS_PER_CLUSTER =
80-
Setting.intSetting("search.remote.connections_per_cluster", 3, 1, Setting.Property.NodeScope, Setting.Property.Deprecated);
81-
8272
/**
8373
* The maximum number of connections that will be established to a remote cluster. For instance if there is only a single
8474
* seed node, other nodes will be discovered up to the given number of nodes in this setting. The default is 3.
8575
*/
8676
public static final Setting<Integer> REMOTE_CONNECTIONS_PER_CLUSTER =
8777
Setting.intSetting(
8878
"cluster.remote.connections_per_cluster",
89-
SEARCH_REMOTE_CONNECTIONS_PER_CLUSTER, // the default needs to three when fallback is removed
79+
3,
9080
1,
9181
Setting.Property.NodeScope);
9282

93-
public static final Setting<TimeValue> SEARCH_REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING =
94-
Setting.positiveTimeSetting(
95-
"search.remote.initial_connect_timeout",
96-
TimeValue.timeValueSeconds(30),
97-
Setting.Property.NodeScope,
98-
Setting.Property.Deprecated);
99-
10083
/**
10184
* The initial connect timeout for remote cluster connections
10285
*/
10386
public static final Setting<TimeValue> REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING =
10487
Setting.positiveTimeSetting(
10588
"cluster.remote.initial_connect_timeout",
106-
SEARCH_REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING, // the default needs to be thirty seconds when fallback is removed
10789
TimeValue.timeValueSeconds(30),
10890
Setting.Property.NodeScope);
10991

110-
public static final Setting<String> SEARCH_REMOTE_NODE_ATTRIBUTE =
111-
Setting.simpleString("search.remote.node.attr", Setting.Property.NodeScope, Setting.Property.Deprecated);
112-
11392
/**
11493
* The name of a node attribute to select nodes that should be connected to in the remote cluster.
11594
* For instance a node can be configured with {@code node.attr.gateway: true} in order to be eligible as a gateway node between
116-
* clusters. In that case {@code search.remote.node.attr: gateway} can be used to filter out other nodes in the remote cluster.
95+
* clusters. In that case {@code cluster.remote.node.attr: gateway} can be used to filter out other nodes in the remote cluster.
11796
* The value of the setting is expected to be a boolean, {@code true} for nodes that can become gateways, {@code false} otherwise.
11897
*/
11998
public static final Setting<String> REMOTE_NODE_ATTRIBUTE =
120-
Setting.simpleString(
121-
"cluster.remote.node.attr",
122-
SEARCH_REMOTE_NODE_ATTRIBUTE, // no default is needed when fallback is removed, use simple string which gives empty
123-
Setting.Property.NodeScope);
124-
125-
public static final Setting<Boolean> SEARCH_ENABLE_REMOTE_CLUSTERS =
126-
Setting.boolSetting("search.remote.connect", true, Setting.Property.NodeScope, Setting.Property.Deprecated);
99+
Setting.simpleString("cluster.remote.node.attr", Setting.Property.NodeScope);
127100

128101
/**
129102
* If <code>true</code> connecting to remote clusters is supported on this node. If <code>false</code> this node will not establish
@@ -133,40 +106,16 @@ public final class RemoteClusterService extends RemoteClusterAware implements Cl
133106
public static final Setting<Boolean> ENABLE_REMOTE_CLUSTERS =
134107
Setting.boolSetting(
135108
"cluster.remote.connect",
136-
SEARCH_ENABLE_REMOTE_CLUSTERS, // the default needs to be true when fallback is removed
109+
true,
137110
Setting.Property.NodeScope);
138111

139-
public static final Setting.AffixSetting<Boolean> SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE =
140-
Setting.affixKeySetting(
141-
"search.remote.",
142-
"skip_unavailable",
143-
key -> boolSetting(key, false, Setting.Property.Deprecated, Setting.Property.Dynamic, Setting.Property.NodeScope),
144-
REMOTE_CLUSTERS_SEEDS);
145-
146-
public static final SettingUpgrader<Boolean> SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE_UPGRADER = new SettingUpgrader<Boolean>() {
147-
148-
@Override
149-
public Setting<Boolean> getSetting() {
150-
return SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE;
151-
}
152-
153-
@Override
154-
public String getKey(final String key) {
155-
return key.replaceFirst("^search", "cluster");
156-
}
157-
158-
};
159-
160112
public static final Setting.AffixSetting<Boolean> REMOTE_CLUSTER_SKIP_UNAVAILABLE =
161113
Setting.affixKeySetting(
162114
"cluster.remote.",
163115
"skip_unavailable",
164116
key -> boolSetting(
165117
key,
166-
// the default needs to be false when fallback is removed
167-
"_na_".equals(key)
168-
? SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE.getConcreteSettingForNamespace(key)
169-
: SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE.getConcreteSetting(key.replaceAll("^cluster", "search")),
118+
false,
170119
Setting.Property.Dynamic,
171120
Setting.Property.NodeScope),
172121
REMOTE_CLUSTERS_SEEDS);
@@ -367,7 +316,6 @@ Set<String> getRemoteClusterNames() {
367316
public void listenForUpdates(ClusterSettings clusterSettings) {
368317
super.listenForUpdates(clusterSettings);
369318
clusterSettings.addAffixUpdateConsumer(REMOTE_CLUSTER_SKIP_UNAVAILABLE, this::updateSkipUnavailable, (alias, value) -> {});
370-
clusterSettings.addAffixUpdateConsumer(SEARCH_REMOTE_CLUSTER_SKIP_UNAVAILABLE, this::updateSkipUnavailable, (alias, value) -> {});
371319
}
372320

373321
private synchronized void updateSkipUnavailable(String clusterAlias, Boolean skipUnavailable) {

0 commit comments

Comments
 (0)