From 513985e0722db7d06980df3e9c1122e1a7109cb9 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Wed, 25 Mar 2020 17:27:09 -0400 Subject: [PATCH] Remove the cluster.remote.connect setting (#54175) In Elasticsearch 7.7.0, the setting cluster.remote.connect was deprecated. In this commit, we remote the setting permanently in favor of setting node.remote_cluster_client. --- .../migration/migrate_8_0/settings.asciidoc | 10 ++++------ .../common/settings/ClusterSettings.java | 1 - .../src/main/java/org/elasticsearch/node/Node.java | 3 +-- .../transport/RemoteClusterService.java | 12 ------------ .../transport/RemoteClusterSettingsTests.java | 7 ------- 5 files changed, 5 insertions(+), 28 deletions(-) diff --git a/docs/reference/migration/migrate_8_0/settings.asciidoc b/docs/reference/migration/migrate_8_0/settings.asciidoc index ba39f3f1221df..663133fed9488 100644 --- a/docs/reference/migration/migrate_8_0/settings.asciidoc +++ b/docs/reference/migration/migrate_8_0/settings.asciidoc @@ -39,10 +39,8 @@ threads, the `node.processors` setting is now bounded by the number of available processors. [float] -==== `cluster.remote.connect` is deprecated in favor of `node.remote_cluster_client` +==== `cluster.remote.connect` is removed -Previously the setting `cluster.remote.connect` was used to configure whether or -not the local node is capable of acting as a remote cluster client in -cross-cluster search and cross-cluster replication. This setting is deprecated -in favor of `node.remote_cluster_client` serves the same purpose and identifies -the local node as having the `remote_cluster_client` role. +In Elasticsearch 7.7.0, the setting `cluster.remote.connect` was deprecated in +favor of setting `node.remote_cluster_client`. In Elasticsearch 8.0.0, the +setting `cluster.remote.connect` is removed. diff --git a/server/src/main/java/org/elasticsearch/common/settings/ClusterSettings.java b/server/src/main/java/org/elasticsearch/common/settings/ClusterSettings.java index 1d254613e95af..719da2b89ff39 100644 --- a/server/src/main/java/org/elasticsearch/common/settings/ClusterSettings.java +++ b/server/src/main/java/org/elasticsearch/common/settings/ClusterSettings.java @@ -294,7 +294,6 @@ public void apply(Settings value, Settings current, Settings previous) { SniffConnectionStrategy.REMOTE_CONNECTIONS_PER_CLUSTER, RemoteClusterService.REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING, RemoteClusterService.REMOTE_NODE_ATTRIBUTE, - RemoteClusterService.ENABLE_REMOTE_CLUSTERS, RemoteClusterService.REMOTE_CLUSTER_PING_SCHEDULE, RemoteClusterService.REMOTE_CLUSTER_COMPRESS, RemoteConnectionStrategy.REMOTE_CONNECTION_MODE, diff --git a/server/src/main/java/org/elasticsearch/node/Node.java b/server/src/main/java/org/elasticsearch/node/Node.java index 63a756887d864..01145e6281161 100644 --- a/server/src/main/java/org/elasticsearch/node/Node.java +++ b/server/src/main/java/org/elasticsearch/node/Node.java @@ -155,7 +155,6 @@ import org.elasticsearch.tasks.TaskResultsService; import org.elasticsearch.threadpool.ExecutorBuilder; import org.elasticsearch.threadpool.ThreadPool; -import org.elasticsearch.transport.RemoteClusterService; import org.elasticsearch.transport.Transport; import org.elasticsearch.transport.TransportInterceptor; import org.elasticsearch.transport.TransportService; @@ -202,7 +201,7 @@ public class Node implements Closeable { public static final Setting NODE_INGEST_SETTING = Setting.boolSetting("node.ingest", true, Property.NodeScope); public static final Setting NODE_REMOTE_CLUSTER_CLIENT = - Setting.boolSetting("node.remote_cluster_client", RemoteClusterService.ENABLE_REMOTE_CLUSTERS, Property.NodeScope); + Setting.boolSetting("node.remote_cluster_client", true, Property.NodeScope); /** * controls whether the node is allowed to persist things like metadata to disk diff --git a/server/src/main/java/org/elasticsearch/transport/RemoteClusterService.java b/server/src/main/java/org/elasticsearch/transport/RemoteClusterService.java index 7dd3006cc4202..745496b98461d 100644 --- a/server/src/main/java/org/elasticsearch/transport/RemoteClusterService.java +++ b/server/src/main/java/org/elasticsearch/transport/RemoteClusterService.java @@ -84,18 +84,6 @@ public final class RemoteClusterService extends RemoteClusterAware implements Cl public static final Setting REMOTE_NODE_ATTRIBUTE = Setting.simpleString("cluster.remote.node.attr", Setting.Property.NodeScope); - /** - * If true connecting to remote clusters is supported on this node. If false this node will not establish - * connections to any remote clusters configured. Search requests executed against this node (where this node is the coordinating node) - * will fail if remote cluster syntax is used as an index pattern. The default is true - */ - public static final Setting ENABLE_REMOTE_CLUSTERS = - Setting.boolSetting( - "cluster.remote.connect", - true, - Setting.Property.Deprecated, - Setting.Property.NodeScope); - public static final Setting.AffixSetting REMOTE_CLUSTER_SKIP_UNAVAILABLE = Setting.affixKeySetting( "cluster.remote.", diff --git a/server/src/test/java/org/elasticsearch/transport/RemoteClusterSettingsTests.java b/server/src/test/java/org/elasticsearch/transport/RemoteClusterSettingsTests.java index 8f262ea2454aa..0ff382fbd2f53 100644 --- a/server/src/test/java/org/elasticsearch/transport/RemoteClusterSettingsTests.java +++ b/server/src/test/java/org/elasticsearch/transport/RemoteClusterSettingsTests.java @@ -19,7 +19,6 @@ package org.elasticsearch.transport; -import org.elasticsearch.common.settings.Setting; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.test.ESTestCase; @@ -27,7 +26,6 @@ import java.util.concurrent.TimeUnit; import static org.elasticsearch.node.Node.NODE_REMOTE_CLUSTER_CLIENT; -import static org.elasticsearch.transport.RemoteClusterService.ENABLE_REMOTE_CLUSTERS; import static org.elasticsearch.transport.RemoteClusterService.REMOTE_CLUSTER_SKIP_UNAVAILABLE; import static org.elasticsearch.transport.RemoteClusterService.REMOTE_INITIAL_CONNECTION_TIMEOUT_SETTING; import static org.elasticsearch.transport.RemoteClusterService.REMOTE_NODE_ATTRIBUTE; @@ -59,11 +57,6 @@ public void testDisableRemoteClusterClient() { assertFalse(NODE_REMOTE_CLUSTER_CLIENT.get(Settings.builder().put(NODE_REMOTE_CLUSTER_CLIENT.getKey(), false).build())); } - public void testDisableEnableRemoteClusters() { - assertFalse(NODE_REMOTE_CLUSTER_CLIENT.get(Settings.builder().put(ENABLE_REMOTE_CLUSTERS.getKey(), false).build())); - assertSettingDeprecationsAndWarnings(new Setting[]{ENABLE_REMOTE_CLUSTERS}); - } - public void testSkipUnavailableDefault() { final String alias = randomAlphaOfLength(8); assertFalse(REMOTE_CLUSTER_SKIP_UNAVAILABLE.getConcreteSettingForNamespace(alias).get(Settings.EMPTY));