From a5f4e47d7bac6c129fbd59f2b9d8d458423eb847 Mon Sep 17 00:00:00 2001 From: David Turner Date: Sun, 3 Feb 2019 20:43:30 +0000 Subject: [PATCH] Deprecate unused Zen1 settings Today the following settings in the `discovery.zen` namespace are still used: - `discovery.zen.no_master_block` - `discovery.zen.hosts_provider` - `discovery.zen.ping.unicast.concurrent_connects` - `discovery.zen.ping.unicast.hosts.resolve_timeout` - `discovery.zen.ping.unicast.hosts` This commit deprecates all other settings in this namespace so that they can be removed in the next major version. --- .../AbstractAzureComputeServiceTestCase.java | 5 ----- .../discovery/gce/GceDiscoverTests.java | 5 ----- .../coordination/DiscoveryUpgradeService.java | 4 ++-- .../discovery/DiscoverySettings.java | 8 ++++---- .../discovery/zen/FaultDetection.java | 10 +++++----- .../discovery/zen/ZenDiscovery.java | 17 +++++++++-------- .../master/IndexingMasterFailoverIT.java | 8 +------- .../cluster/MinimumMasterNodesIT.java | 5 ----- .../allocation/AwarenessAllocationIT.java | 3 --- .../discovery/AbstractDisruptionTestCase.java | 5 ----- .../discovery/ClusterDisruptionIT.java | 8 ++------ .../discovery/SnapshotDisruptionIT.java | 1 - .../discovery/ZenFaultDetectionTests.java | 18 ++++++++++++++++++ .../zen/PublishClusterStateActionTests.java | 18 ++++++++++++++++++ .../recovery/FullRollingRestartIT.java | 12 +++++------- .../test/test/InternalTestClusterTests.java | 5 ----- .../ml/integration/NetworkDisruptionIT.java | 6 ------ 17 files changed, 64 insertions(+), 74 deletions(-) diff --git a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java index cfde40c0b524b..7d77b9994d589 100644 --- a/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java +++ b/plugins/discovery-azure-classic/src/test/java/org/elasticsearch/cloud/azure/classic/AbstractAzureComputeServiceTestCase.java @@ -35,7 +35,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.TransportAddress; import org.elasticsearch.discovery.azure.classic.AzureUnicastHostsProvider; -import org.elasticsearch.discovery.zen.ZenDiscovery; import org.elasticsearch.plugin.discovery.azure.classic.AzureDiscoveryPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; @@ -66,10 +65,6 @@ protected Settings nodeSettings(int nodeOrdinal) { .put(super.nodeSettings(nodeOrdinal)) .put("discovery.zen.hosts_provider", "azure"); - // Make the test run faster - builder.put(ZenDiscovery.JOIN_TIMEOUT_SETTING.getKey(), "1s") - .put(ZenDiscovery.PING_TIMEOUT_SETTING.getKey(), "500ms"); - // We add a fake subscription_id to start mock compute service builder.put(Management.SUBSCRIPTION_ID_SETTING.getKey(), "fake") .put(Discovery.REFRESH_SETTING.getKey(), "5s") diff --git a/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java b/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java index 6df580dd8a52c..078a21ee842b6 100644 --- a/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java +++ b/plugins/discovery-gce/src/test/java/org/elasticsearch/discovery/gce/GceDiscoverTests.java @@ -26,7 +26,6 @@ import org.elasticsearch.cloud.gce.util.Access; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.discovery.zen.ZenDiscovery; import org.elasticsearch.plugin.discovery.gce.GceDiscoveryPlugin; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; @@ -43,7 +42,6 @@ import static java.util.Collections.singletonList; import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoTimeout; - @ESIntegTestCase.ClusterScope(supportsDedicatedMasters = false, numDataNodes = 0, numClientNodes = 0) public class GceDiscoverTests extends ESIntegTestCase { @@ -67,9 +65,6 @@ protected Settings nodeSettings(int nodeOrdinal) { .put("discovery.zen.hosts_provider", "gce") .put("cloud.gce.project_id", "test") .put("cloud.gce.zone", "test") - // Make the test run faster - .put(ZenDiscovery.JOIN_TIMEOUT_SETTING.getKey(), "1s") - .put(ZenDiscovery.PING_TIMEOUT_SETTING.getKey(), "500ms") .build(); } diff --git a/server/src/main/java/org/elasticsearch/cluster/coordination/DiscoveryUpgradeService.java b/server/src/main/java/org/elasticsearch/cluster/coordination/DiscoveryUpgradeService.java index e793e407e1a89..3bf5fa225a934 100644 --- a/server/src/main/java/org/elasticsearch/cluster/coordination/DiscoveryUpgradeService.java +++ b/server/src/main/java/org/elasticsearch/cluster/coordination/DiscoveryUpgradeService.java @@ -77,11 +77,11 @@ public class DiscoveryUpgradeService { // how long to wait after activation before attempting to join a master or perform a bootstrap upgrade public static final Setting BWC_PING_TIMEOUT_SETTING = Setting.timeSetting("discovery.zen.bwc_ping_timeout", - PING_TIMEOUT_SETTING, TimeValue.timeValueMillis(1), Setting.Property.NodeScope); + PING_TIMEOUT_SETTING, TimeValue.timeValueMillis(1), Setting.Property.NodeScope, Setting.Property.Deprecated); // whether to try and bootstrap all the discovered Zen2 nodes when the last Zen1 node leaves the cluster. public static final Setting ENABLE_UNSAFE_BOOTSTRAPPING_ON_UPGRADE_SETTING = - Setting.boolSetting("discovery.zen.unsafe_rolling_upgrades_enabled", true, Setting.Property.NodeScope); + Setting.boolSetting("discovery.zen.unsafe_rolling_upgrades_enabled", true, Setting.Property.NodeScope, Setting.Property.Deprecated); /** * Dummy {@link ElectMasterService} that is only used to choose the best 6.x master from the discovered nodes, ignoring the diff --git a/server/src/main/java/org/elasticsearch/discovery/DiscoverySettings.java b/server/src/main/java/org/elasticsearch/discovery/DiscoverySettings.java index 8cb2f6cf672f4..1e99fdc3702df 100644 --- a/server/src/main/java/org/elasticsearch/discovery/DiscoverySettings.java +++ b/server/src/main/java/org/elasticsearch/discovery/DiscoverySettings.java @@ -46,21 +46,21 @@ public class DiscoverySettings { **/ public static final Setting PUBLISH_TIMEOUT_SETTING = Setting.positiveTimeSetting("discovery.zen.publish_timeout", TimeValue.timeValueSeconds(30), - Property.Dynamic, Property.NodeScope); + Property.Dynamic, Property.NodeScope, Property.Deprecated); /** * sets the timeout for receiving enough acks for a specific cluster state and committing it. failing * to receive responses within this window will cause the cluster state change to be rejected. */ public static final Setting COMMIT_TIMEOUT_SETTING = - new Setting<>("discovery.zen.commit_timeout", (s) -> PUBLISH_TIMEOUT_SETTING.getRaw(s), + new Setting<>("discovery.zen.commit_timeout", PUBLISH_TIMEOUT_SETTING::getRaw, (s) -> TimeValue.parseTimeValue(s, TimeValue.timeValueSeconds(30), "discovery.zen.commit_timeout"), - Property.Dynamic, Property.NodeScope); + Property.Dynamic, Property.NodeScope, Property.Deprecated); public static final Setting NO_MASTER_BLOCK_SETTING = new Setting<>("discovery.zen.no_master_block", "write", DiscoverySettings::parseNoMasterBlock, Property.Dynamic, Property.NodeScope); public static final Setting PUBLISH_DIFF_ENABLE_SETTING = - Setting.boolSetting("discovery.zen.publish_diff.enable", true, Property.Dynamic, Property.NodeScope); + Setting.boolSetting("discovery.zen.publish_diff.enable", true, Property.Dynamic, Property.NodeScope, Property.Deprecated); public static final Setting INITIAL_STATE_TIMEOUT_SETTING = Setting.positiveTimeSetting("discovery.initial_state_timeout", TimeValue.timeValueSeconds(30), Property.NodeScope); diff --git a/server/src/main/java/org/elasticsearch/discovery/zen/FaultDetection.java b/server/src/main/java/org/elasticsearch/discovery/zen/FaultDetection.java index 5c731621179ac..424dc6d31b0b3 100644 --- a/server/src/main/java/org/elasticsearch/discovery/zen/FaultDetection.java +++ b/server/src/main/java/org/elasticsearch/discovery/zen/FaultDetection.java @@ -45,15 +45,15 @@ public abstract class FaultDetection implements Closeable { private static final Logger logger = LogManager.getLogger(FaultDetection.class); public static final Setting CONNECT_ON_NETWORK_DISCONNECT_SETTING = - Setting.boolSetting("discovery.zen.fd.connect_on_network_disconnect", false, Property.NodeScope); + Setting.boolSetting("discovery.zen.fd.connect_on_network_disconnect", false, Property.NodeScope, Property.Deprecated); public static final Setting PING_INTERVAL_SETTING = - Setting.positiveTimeSetting("discovery.zen.fd.ping_interval", timeValueSeconds(1), Property.NodeScope); + Setting.positiveTimeSetting("discovery.zen.fd.ping_interval", timeValueSeconds(1), Property.NodeScope, Property.Deprecated); public static final Setting PING_TIMEOUT_SETTING = - Setting.timeSetting("discovery.zen.fd.ping_timeout", timeValueSeconds(30), Property.NodeScope); + Setting.timeSetting("discovery.zen.fd.ping_timeout", timeValueSeconds(30), Property.NodeScope, Property.Deprecated); public static final Setting PING_RETRIES_SETTING = - Setting.intSetting("discovery.zen.fd.ping_retries", 3, Property.NodeScope); + Setting.intSetting("discovery.zen.fd.ping_retries", 3, Property.NodeScope, Property.Deprecated); public static final Setting REGISTER_CONNECTION_LISTENER_SETTING = - Setting.boolSetting("discovery.zen.fd.register_connection_listener", true, Property.NodeScope); + Setting.boolSetting("discovery.zen.fd.register_connection_listener", true, Property.NodeScope, Property.Deprecated); protected final ThreadPool threadPool; protected final ClusterName clusterName; diff --git a/server/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java b/server/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java index e48cc210ac122..9c85217f17804 100644 --- a/server/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java +++ b/server/src/main/java/org/elasticsearch/discovery/zen/ZenDiscovery.java @@ -96,23 +96,24 @@ public class ZenDiscovery extends AbstractLifecycleComponent implements Discover public static final Setting JOIN_TIMEOUT_SETTING = Setting.timeSetting("discovery.zen.join_timeout", settings -> TimeValue.timeValueMillis(PING_TIMEOUT_SETTING.get(settings).millis() * 20), - TimeValue.timeValueMillis(0), Property.NodeScope); + TimeValue.timeValueMillis(0), Property.NodeScope, Property.Deprecated); public static final Setting JOIN_RETRY_ATTEMPTS_SETTING = - Setting.intSetting("discovery.zen.join_retry_attempts", 3, 1, Property.NodeScope); + Setting.intSetting("discovery.zen.join_retry_attempts", 3, 1, Property.NodeScope, Property.Deprecated); public static final Setting JOIN_RETRY_DELAY_SETTING = - Setting.positiveTimeSetting("discovery.zen.join_retry_delay", TimeValue.timeValueMillis(100), Property.NodeScope); + Setting.positiveTimeSetting("discovery.zen.join_retry_delay", TimeValue.timeValueMillis(100), + Property.NodeScope, Property.Deprecated); public static final Setting MAX_PINGS_FROM_ANOTHER_MASTER_SETTING = - Setting.intSetting("discovery.zen.max_pings_from_another_master", 3, 1, Property.NodeScope); + Setting.intSetting("discovery.zen.max_pings_from_another_master", 3, 1, Property.NodeScope, Property.Deprecated); public static final Setting SEND_LEAVE_REQUEST_SETTING = - Setting.boolSetting("discovery.zen.send_leave_request", true, Property.NodeScope); + Setting.boolSetting("discovery.zen.send_leave_request", true, Property.NodeScope, Property.Deprecated); public static final Setting MASTER_ELECTION_WAIT_FOR_JOINS_TIMEOUT_SETTING = Setting.timeSetting("discovery.zen.master_election.wait_for_joins_timeout", settings -> TimeValue.timeValueMillis(JOIN_TIMEOUT_SETTING.get(settings).millis() / 2), TimeValue.timeValueMillis(0), - Property.NodeScope); + Property.NodeScope, Property.Deprecated); public static final Setting MASTER_ELECTION_IGNORE_NON_MASTER_PINGS_SETTING = - Setting.boolSetting("discovery.zen.master_election.ignore_non_master_pings", false, Property.NodeScope); + Setting.boolSetting("discovery.zen.master_election.ignore_non_master_pings", false, Property.NodeScope, Property.Deprecated); public static final Setting MAX_PENDING_CLUSTER_STATES_SETTING = - Setting.intSetting("discovery.zen.publish.max_pending_cluster_states", 25, 1, Property.NodeScope); + Setting.intSetting("discovery.zen.publish.max_pending_cluster_states", 25, 1, Property.NodeScope, Property.Deprecated); public static final String DISCOVERY_REJOIN_ACTION_NAME = "internal:discovery/zen/rejoin"; diff --git a/server/src/test/java/org/elasticsearch/action/support/master/IndexingMasterFailoverIT.java b/server/src/test/java/org/elasticsearch/action/support/master/IndexingMasterFailoverIT.java index 6b51836b4381d..4068d36ec40d9 100644 --- a/server/src/test/java/org/elasticsearch/action/support/master/IndexingMasterFailoverIT.java +++ b/server/src/test/java/org/elasticsearch/action/support/master/IndexingMasterFailoverIT.java @@ -1,5 +1,3 @@ -package org.elasticsearch.action.support.master; - /* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with @@ -18,12 +16,11 @@ * specific language governing permissions and limitations * under the License. */ +package org.elasticsearch.action.support.master; import org.elasticsearch.action.DocWriteResponse; import org.elasticsearch.action.index.IndexResponse; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.discovery.DiscoverySettings; -import org.elasticsearch.discovery.zen.FaultDetection; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.discovery.TestZenDiscovery; @@ -69,10 +66,7 @@ public void testMasterFailoverDuringIndexingWithMappingChanges() throws Throwabl logger.info("--> start 4 nodes, 3 master, 1 data"); final Settings sharedSettings = Settings.builder() - .put(FaultDetection.PING_TIMEOUT_SETTING.getKey(), "1s") // for hitting simulated network failures quickly - .put(FaultDetection.PING_RETRIES_SETTING.getKey(), "1") // for hitting simulated network failures quickly .put("cluster.join.timeout", "10s") // still long to induce failures but not too long so test won't time out - .put(DiscoverySettings.PUBLISH_TIMEOUT_SETTING.getKey(), "1s") // <-- for hitting simulated network failures quickly .build(); internalCluster().setBootstrapMasterNodeIndex(2); diff --git a/server/src/test/java/org/elasticsearch/cluster/MinimumMasterNodesIT.java b/server/src/test/java/org/elasticsearch/cluster/MinimumMasterNodesIT.java index 4b23cd223a9dd..03fa2407685d8 100644 --- a/server/src/test/java/org/elasticsearch/cluster/MinimumMasterNodesIT.java +++ b/server/src/test/java/org/elasticsearch/cluster/MinimumMasterNodesIT.java @@ -32,7 +32,6 @@ import org.elasticsearch.common.Priority; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.discovery.DiscoverySettings; -import org.elasticsearch.discovery.zen.ZenDiscovery; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESIntegTestCase; @@ -75,7 +74,6 @@ public void testTwoNodesNoMasterBlock() throws Exception { internalCluster().setBootstrapMasterNodeIndex(1); Settings settings = Settings.builder() - .put(ZenDiscovery.PING_TIMEOUT_SETTING.getKey(), "200ms") .put("discovery.initial_state_timeout", "500ms") .build(); @@ -208,7 +206,6 @@ public void testThreeNodesNoMasterBlock() throws Exception { internalCluster().setBootstrapMasterNodeIndex(2); Settings settings = Settings.builder() - .put(ZenDiscovery.PING_TIMEOUT_SETTING.getKey(), "1s") .put("discovery.initial_state_timeout", "500ms") .build(); @@ -283,9 +280,7 @@ public void testCannotCommitStateThreeNodes() throws Exception { internalCluster().setBootstrapMasterNodeIndex(2); Settings settings = Settings.builder() - .put(ZenDiscovery.PING_TIMEOUT_SETTING.getKey(), "200ms") .put("discovery.initial_state_timeout", "500ms") - .put(DiscoverySettings.COMMIT_TIMEOUT_SETTING.getKey(), "100ms") // speed things up .build(); internalCluster().startNodes(3, settings); diff --git a/server/src/test/java/org/elasticsearch/cluster/allocation/AwarenessAllocationIT.java b/server/src/test/java/org/elasticsearch/cluster/allocation/AwarenessAllocationIT.java index fe63d1c39e4ae..083c914b37052 100644 --- a/server/src/test/java/org/elasticsearch/cluster/allocation/AwarenessAllocationIT.java +++ b/server/src/test/java/org/elasticsearch/cluster/allocation/AwarenessAllocationIT.java @@ -20,7 +20,6 @@ package org.elasticsearch.cluster.allocation; import com.carrotsearch.hppc.ObjectIntHashMap; - import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; @@ -31,7 +30,6 @@ import org.elasticsearch.cluster.routing.allocation.decider.AwarenessAllocationDecider; import org.elasticsearch.common.Priority; import org.elasticsearch.common.settings.Settings; -import org.elasticsearch.discovery.zen.ZenDiscovery; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; @@ -105,7 +103,6 @@ public void testAwarenessZones() throws Exception { Settings commonSettings = Settings.builder() .put(AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_FORCE_GROUP_SETTING.getKey() + "zone.values", "a,b") .put(AwarenessAllocationDecider.CLUSTER_ROUTING_ALLOCATION_AWARENESS_ATTRIBUTE_SETTING.getKey(), "zone") - .put(ZenDiscovery.JOIN_TIMEOUT_SETTING.getKey(), "10s") .build(); logger.info("--> starting 4 nodes on different zones"); diff --git a/server/src/test/java/org/elasticsearch/discovery/AbstractDisruptionTestCase.java b/server/src/test/java/org/elasticsearch/discovery/AbstractDisruptionTestCase.java index 703c7346268d9..825a4203ef9a0 100644 --- a/server/src/test/java/org/elasticsearch/discovery/AbstractDisruptionTestCase.java +++ b/server/src/test/java/org/elasticsearch/discovery/AbstractDisruptionTestCase.java @@ -30,7 +30,6 @@ import org.elasticsearch.common.Nullable; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.discovery.zen.FaultDetection; import org.elasticsearch.discovery.zen.UnicastZenPing; import org.elasticsearch.discovery.zen.ZenPing; import org.elasticsearch.plugins.Plugin; @@ -132,15 +131,11 @@ protected void clearTemporalResponses() { } static final Settings DEFAULT_SETTINGS = Settings.builder() - .put(FaultDetection.PING_TIMEOUT_SETTING.getKey(), "1s") // for hitting simulated network failures quickly - .put(FaultDetection.PING_RETRIES_SETTING.getKey(), "1") // for hitting simulated network failures quickly .put(LeaderChecker.LEADER_CHECK_TIMEOUT_SETTING.getKey(), "1s") // for hitting simulated network failures quickly .put(LeaderChecker.LEADER_CHECK_RETRY_COUNT_SETTING.getKey(), 1) // for hitting simulated network failures quickly .put(FollowersChecker.FOLLOWER_CHECK_TIMEOUT_SETTING.getKey(), "1s") // for hitting simulated network failures quickly .put(FollowersChecker.FOLLOWER_CHECK_RETRY_COUNT_SETTING.getKey(), 1) // for hitting simulated network failures quickly - .put("discovery.zen.join_timeout", "10s") // still long to induce failures but to long so test won't time out .put(JoinHelper.JOIN_TIMEOUT_SETTING.getKey(), "10s") // still long to induce failures but to long so test won't time out - .put(DiscoverySettings.PUBLISH_TIMEOUT_SETTING.getKey(), "1s") // <-- for hitting simulated network failures quickly .put(Coordinator.PUBLISH_TIMEOUT_SETTING.getKey(), "1s") // <-- for hitting simulated network failures quickly .put(TransportSettings.CONNECT_TIMEOUT.getKey(), "10s") // Network delay disruption waits for the min between this // value and the time of disruption and does not recover immediately diff --git a/server/src/test/java/org/elasticsearch/discovery/ClusterDisruptionIT.java b/server/src/test/java/org/elasticsearch/discovery/ClusterDisruptionIT.java index 78b6b81189c2b..d8262dc4f576d 100644 --- a/server/src/test/java/org/elasticsearch/discovery/ClusterDisruptionIT.java +++ b/server/src/test/java/org/elasticsearch/discovery/ClusterDisruptionIT.java @@ -388,13 +388,9 @@ public boolean validateClusterForming() { * Test for https://github.com/elastic/elasticsearch/issues/11665 */ public void testIndicesDeleted() throws Exception { - final Settings settings = Settings.builder() - .put(DiscoverySettings.PUBLISH_TIMEOUT_SETTING.getKey(), "0s") // don't wait on isolated data node - .put(DiscoverySettings.COMMIT_TIMEOUT_SETTING.getKey(), "30s") // wait till cluster state is committed - .build(); final String idxName = "test"; - final List allMasterEligibleNodes = internalCluster().startMasterOnlyNodes(2, settings); - final String dataNode = internalCluster().startDataOnlyNode(settings); + final List allMasterEligibleNodes = internalCluster().startMasterOnlyNodes(2); + final String dataNode = internalCluster().startDataOnlyNode(); ensureStableCluster(3); assertAcked(prepareCreate("test")); diff --git a/server/src/test/java/org/elasticsearch/discovery/SnapshotDisruptionIT.java b/server/src/test/java/org/elasticsearch/discovery/SnapshotDisruptionIT.java index db3c71c398da7..d732f51bd542a 100644 --- a/server/src/test/java/org/elasticsearch/discovery/SnapshotDisruptionIT.java +++ b/server/src/test/java/org/elasticsearch/discovery/SnapshotDisruptionIT.java @@ -71,7 +71,6 @@ protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder().put(super.nodeSettings(nodeOrdinal)) .put(AbstractDisruptionTestCase.DEFAULT_SETTINGS) .put(TestZenDiscovery.USE_MOCK_PINGS.getKey(), false) - .put(DiscoverySettings.COMMIT_TIMEOUT_SETTING.getKey(), "30s") .build(); } diff --git a/server/src/test/java/org/elasticsearch/discovery/ZenFaultDetectionTests.java b/server/src/test/java/org/elasticsearch/discovery/ZenFaultDetectionTests.java index 85d8f95c6b109..4aea0892e8257 100644 --- a/server/src/test/java/org/elasticsearch/discovery/ZenFaultDetectionTests.java +++ b/server/src/test/java/org/elasticsearch/discovery/ZenFaultDetectionTests.java @@ -223,6 +223,12 @@ public void onNodeFailure(DiscoveryNode node, String reason) { } assertThat(failureReason[0], matcher); + + assertWarnings( + "[discovery.zen.fd.connect_on_network_disconnect] setting was deprecated in Elasticsearch and will be removed in a future " + + "release! See the breaking changes documentation for the next major version.", + "[discovery.zen.fd.ping_interval] setting was deprecated in Elasticsearch and will be removed in a future " + + "release! See the breaking changes documentation for the next major version."); } public void testMasterFaultDetectionConnectOnDisconnect() throws InterruptedException { @@ -262,6 +268,12 @@ public void testMasterFaultDetectionConnectOnDisconnect() throws InterruptedExce } assertThat(failureReason[0], matcher); + + assertWarnings( + "[discovery.zen.fd.connect_on_network_disconnect] setting was deprecated in Elasticsearch and will be removed in a future " + + "release! See the breaking changes documentation for the next major version.", + "[discovery.zen.fd.ping_interval] setting was deprecated in Elasticsearch and will be removed in a future " + + "release! See the breaking changes documentation for the next major version."); } public void testMasterFaultDetectionNotSizeLimited() throws InterruptedException { @@ -301,6 +313,12 @@ public void testMasterFaultDetectionNotSizeLimited() throws InterruptedException assertThat(inFlightRequestsBreaker.getTrippedCount(), equalTo(0L)); assertThat(pingProbeA.completedPings(), greaterThanOrEqualTo(minExpectedPings)); assertThat(pingProbeB.completedPings(), greaterThanOrEqualTo(minExpectedPings)); + + assertWarnings( + "[discovery.zen.fd.connect_on_network_disconnect] setting was deprecated in Elasticsearch and will be removed in a future " + + "release! See the breaking changes documentation for the next major version.", + "[discovery.zen.fd.ping_interval] setting was deprecated in Elasticsearch and will be removed in a future " + + "release! See the breaking changes documentation for the next major version."); } private static class PingProbe extends MockTransportService.Tracer { diff --git a/server/src/test/java/org/elasticsearch/discovery/zen/PublishClusterStateActionTests.java b/server/src/test/java/org/elasticsearch/discovery/zen/PublishClusterStateActionTests.java index 183df5c956405..2f7a26af7cb58 100644 --- a/server/src/test/java/org/elasticsearch/discovery/zen/PublishClusterStateActionTests.java +++ b/server/src/test/java/org/elasticsearch/discovery/zen/PublishClusterStateActionTests.java @@ -413,6 +413,10 @@ public void clusterChanged(ClusterChangedEvent event) { clusterState = ClusterState.builder(clusterState).blocks(ClusterBlocks.builder() .addGlobalBlock(MetaData.CLUSTER_READ_ONLY_BLOCK)).incrementVersion().build(); publishStateAndWait(nodeA.action, clusterState, previousClusterState); + + assertWarnings( + "[discovery.zen.publish_diff.enable] setting was deprecated in Elasticsearch and will be removed in a future release! " + + "See the breaking changes documentation for the next major version."); } @@ -464,6 +468,10 @@ public void clusterChanged(ClusterChangedEvent event) { assertSameState(node.clusterState, clusterState); assertThat(node.clusterState.nodes().getLocalNode(), equalTo(node.discoveryNode)); } + + assertWarnings( + "[discovery.zen.publish_diff.enable] setting was deprecated in Elasticsearch and will be removed in a future release! " + + "See the breaking changes documentation for the next major version."); } public void testSerializationFailureDuringDiffPublishing() throws Exception { @@ -625,6 +633,12 @@ public void testPublishingWithSendingErrors() throws Exception { } assertThat(exception.getMessage(), containsString(timeOutNodes > 0 ? "timed out" : "failed")); } + + assertWarnings( + "[discovery.zen.publish_timeout] setting was deprecated in Elasticsearch and will be removed in a future release! " + + "See the breaking changes documentation for the next major version.", + "[discovery.zen.commit_timeout] setting was deprecated in Elasticsearch and will be removed in a future release! " + + "See the breaking changes documentation for the next major version."); } public void testOutOfOrderCommitMessages() throws Throwable { @@ -707,6 +721,10 @@ public void testTimeoutOrCommit() throws Exception { assertThat(node.clusterState.stateUUID(), not(equalTo(state.stateUUID()))); } } + + assertWarnings( + "[discovery.zen.commit_timeout] setting was deprecated in Elasticsearch and will be removed in a future release! " + + "See the breaking changes documentation for the next major version."); } private void assertPublishClusterStateStats(String description, MockNode node, long expectedFull, long expectedIncompatibleDiffs, diff --git a/server/src/test/java/org/elasticsearch/recovery/FullRollingRestartIT.java b/server/src/test/java/org/elasticsearch/recovery/FullRollingRestartIT.java index 0fb5f7ac114d6..2c32d6eb33ba8 100644 --- a/server/src/test/java/org/elasticsearch/recovery/FullRollingRestartIT.java +++ b/server/src/test/java/org/elasticsearch/recovery/FullRollingRestartIT.java @@ -30,7 +30,6 @@ import org.elasticsearch.common.collect.MapBuilder; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.TimeValue; -import org.elasticsearch.discovery.zen.ZenDiscovery; import org.elasticsearch.indices.recovery.RecoveryState; import org.elasticsearch.test.ESIntegTestCase; import org.elasticsearch.test.ESIntegTestCase.ClusterScope; @@ -55,8 +54,7 @@ protected int numberOfReplicas() { } public void testFullRollingRestart() throws Exception { - Settings settings = Settings.builder().put(ZenDiscovery.JOIN_TIMEOUT_SETTING.getKey(), "30s").build(); - internalCluster().startNode(settings); + internalCluster().startNode(); createIndex("test"); final String healthTimeout = "1m"; @@ -72,16 +70,16 @@ public void testFullRollingRestart() throws Exception { } logger.info("--> now start adding nodes"); - internalCluster().startNode(settings); - internalCluster().startNode(settings); + internalCluster().startNode(); + internalCluster().startNode(); // make sure the cluster state is green, and all has been recovered assertTimeout(client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setTimeout(healthTimeout) .setWaitForGreenStatus().setWaitForNoRelocatingShards(true).setWaitForNodes("3")); logger.info("--> add two more nodes"); - internalCluster().startNode(settings); - internalCluster().startNode(settings); + internalCluster().startNode(); + internalCluster().startNode(); // make sure the cluster state is green, and all has been recovered assertTimeout(client().admin().cluster().prepareHealth().setWaitForEvents(Priority.LANGUID).setTimeout(healthTimeout) diff --git a/test/framework/src/test/java/org/elasticsearch/test/test/InternalTestClusterTests.java b/test/framework/src/test/java/org/elasticsearch/test/test/InternalTestClusterTests.java index b48c9b9ddcf18..e75d7eab626a8 100644 --- a/test/framework/src/test/java/org/elasticsearch/test/test/InternalTestClusterTests.java +++ b/test/framework/src/test/java/org/elasticsearch/test/test/InternalTestClusterTests.java @@ -1,4 +1,3 @@ - /* * Licensed to Elasticsearch under one or more contributor * license agreements. See the NOTICE file distributed with @@ -30,7 +29,6 @@ import org.elasticsearch.discovery.DiscoveryModule; import org.elasticsearch.discovery.DiscoverySettings; import org.elasticsearch.discovery.zen.SettingsBasedHostsProvider; -import org.elasticsearch.discovery.zen.ZenDiscovery; import org.elasticsearch.env.NodeEnvironment; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.ESTestCase; @@ -339,9 +337,6 @@ public Settings nodeSettings(int nodeOrdinal) { .put(NodeEnvironment.MAX_LOCAL_STORAGE_NODES_SETTING.getKey(), numNodes) .put(NetworkModule.TRANSPORT_TYPE_KEY, getTestTransportType()) .put(DiscoverySettings.INITIAL_STATE_TIMEOUT_SETTING.getKey(), 0) - // speedup join timeout as setting initial state timeout to 0 makes split - // elections more likely - .put(ZenDiscovery.JOIN_TIMEOUT_SETTING.getKey(), "3s") .putList(DISCOVERY_HOSTS_PROVIDER_SETTING.getKey(), "file") .putList(SettingsBasedHostsProvider.DISCOVERY_ZEN_PING_UNICAST_HOSTS_SETTING.getKey()) .build(); diff --git a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/NetworkDisruptionIT.java b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/NetworkDisruptionIT.java index 3304963ae3570..5429bddc437c4 100644 --- a/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/NetworkDisruptionIT.java +++ b/x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/integration/NetworkDisruptionIT.java @@ -11,8 +11,6 @@ import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.unit.ByteSizeUnit; import org.elasticsearch.common.unit.ByteSizeValue; -import org.elasticsearch.discovery.DiscoverySettings; -import org.elasticsearch.discovery.zen.FaultDetection; import org.elasticsearch.index.query.QueryBuilders; import org.elasticsearch.plugins.Plugin; import org.elasticsearch.test.discovery.TestZenDiscovery; @@ -39,10 +37,6 @@ public class NetworkDisruptionIT extends BaseMlIntegTestCase { protected Settings nodeSettings(int nodeOrdinal) { return Settings.builder().put(super.nodeSettings(nodeOrdinal)) .put(TestZenDiscovery.USE_MOCK_PINGS.getKey(), false) - .put(FaultDetection.PING_TIMEOUT_SETTING.getKey(), "1s") // for hitting simulated network failures quickly - .put(FaultDetection.PING_RETRIES_SETTING.getKey(), "1") // for hitting simulated network failures quickly - .put(DiscoverySettings.PUBLISH_TIMEOUT_SETTING.getKey(), "1s") // for hitting simulated network failures quickly - .put("discovery.zen.join_timeout", "10s") // still long to induce failures but not too long so test won't time out .build(); }