From 8fe453c65e3ae9c42a68f984979930968c4c0f7f Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 31 Oct 2018 15:32:16 +0000 Subject: [PATCH 1/2] Pre-populate unicast hosts files Today when ESIntegTestCase starts some nodes it writes out the unicast hosts files each time a node starts its transport service. This does mean that a number of nodes can start and perform their first pinging round without any unicast hosts which, if the timing is unlucky and a lot of nodes are all started at the same time, can lead to a split brain as in #35052. Prior to #33554 this was unlikely to happen since the MockUncasedHostsProvider would always have yielded the existing hosts, so the timing would have to have been implausibly unlucky. Since #33554, however, it's more likely because the race occurs between the start of the first round of pinging and the writing of the unicast hosts file. It is realistic that new nodes will be configured with the existing nodes from startup, so this change reinstates that behaviour Closes #35052. --- .../main/java/org/elasticsearch/test/InternalTestCluster.java | 1 + 1 file changed, 1 insertion(+) diff --git a/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java b/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java index de4226bf2755b..c8d380cf09511 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java +++ b/test/framework/src/main/java/org/elasticsearch/test/InternalTestCluster.java @@ -1562,6 +1562,7 @@ private synchronized void startAndPublishNodesAndClients(List nod // if we're adding too many master-eligible nodes at once, we can't update the min master setting before adding the nodes. updateMinMasterNodes(currentMasters + newMasters); } + rebuildUnicastHostFiles(nodeAndClients); // ensure that new nodes can find the existing nodes when they start List> futures = nodeAndClients.stream().map(node -> executor.submit(node::startNode)).collect(Collectors.toList()); try { From 0dd565e4f0014de9d09e0bb628bb14e46bd83c61 Mon Sep 17 00:00:00 2001 From: David Turner Date: Wed, 31 Oct 2018 15:43:21 +0000 Subject: [PATCH 2/2] Revert "Increase discovery log level in NetworkDisruptionIT" This reverts commit f7760ddacb2f2600e2c0de23ca7b218c63913825. --- .../elasticsearch/xpack/ml/integration/NetworkDisruptionIT.java | 2 -- 1 file changed, 2 deletions(-) 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 beaf8a45c1572..67138cde5bd85 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 @@ -25,7 +25,6 @@ import org.elasticsearch.xpack.core.ml.job.persistence.AnomalyDetectorsIndex; import org.elasticsearch.xpack.core.ml.job.process.autodetect.state.Quantiles; import org.elasticsearch.xpack.ml.support.BaseMlIntegTestCase; -import org.elasticsearch.test.junit.annotations.TestLogging; import java.util.ArrayList; import java.util.Arrays; @@ -54,7 +53,6 @@ protected Collection> nodePlugins() { return plugins; } - @TestLogging("org.elasticsearch.discovery.zen:TRACE") public void testJobRelocation() throws Exception { internalCluster().ensureAtLeastNumDataNodes(5); ensureStableCluster(5);