From c81634725383e1bd409639088297a7d404bf4468 Mon Sep 17 00:00:00 2001 From: Yannick Welsch Date: Wed, 21 Nov 2018 16:31:44 +0100 Subject: [PATCH] Disable testClusterJoinDespiteOfPublishingIssues for Zen2 This test is failing sometimes with Zen2 due to the lack of lag detection. Zen1 does not have this problem as it only considers a join as valid if the corresponding cluster state update is successfully published and committed on the joining node. --- .../discovery/DiscoveryDisruptionIT.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/server/src/test/java/org/elasticsearch/discovery/DiscoveryDisruptionIT.java b/server/src/test/java/org/elasticsearch/discovery/DiscoveryDisruptionIT.java index 8fead42d2f5..3effaa87761 100644 --- a/server/src/test/java/org/elasticsearch/discovery/DiscoveryDisruptionIT.java +++ b/server/src/test/java/org/elasticsearch/discovery/DiscoveryDisruptionIT.java @@ -30,6 +30,7 @@ import org.elasticsearch.discovery.zen.MembershipAction; import org.elasticsearch.discovery.zen.PublishClusterStateAction; import org.elasticsearch.discovery.zen.ZenDiscovery; import org.elasticsearch.test.ESIntegTestCase; +import org.elasticsearch.test.discovery.TestZenDiscovery; import org.elasticsearch.test.disruption.NetworkDisruption; import org.elasticsearch.test.disruption.NetworkDisruption.NetworkDisconnect; import org.elasticsearch.test.disruption.NetworkDisruption.TwoPartitions; @@ -132,8 +133,11 @@ public class DiscoveryDisruptionIT extends AbstractDisruptionTestCase { * Test cluster join with issues in cluster state publishing * */ public void testClusterJoinDespiteOfPublishingIssues() throws Exception { - String masterNode = internalCluster().startMasterOnlyNode(Settings.EMPTY); - String nonMasterNode = internalCluster().startDataOnlyNode(Settings.EMPTY); + // TODO: enable this for Zen2 once lag-detection is implemented + String masterNode = internalCluster().startMasterOnlyNode( + Settings.builder().put(TestZenDiscovery.USE_ZEN2.getKey(), false).build()); + String nonMasterNode = internalCluster().startDataOnlyNode( + Settings.builder().put(TestZenDiscovery.USE_ZEN2.getKey(), false).build()); DiscoveryNodes discoveryNodes = internalCluster().getInstance(ClusterService.class, nonMasterNode).state().nodes(); @@ -153,11 +157,11 @@ public class DiscoveryDisruptionIT extends AbstractDisruptionTestCase { TransportService localTransportService = internalCluster().getInstance(TransportService.class, discoveryNodes.getLocalNode().getName()); if (randomBoolean()) { - masterTransportService.addFailToSendNoConnectRule(localTransportService, PublishClusterStateAction.SEND_ACTION_NAME); - masterTransportService.addFailToSendNoConnectRule(localTransportService, PublicationTransportHandler.PUBLISH_STATE_ACTION_NAME); + masterTransportService.addFailToSendNoConnectRule(localTransportService, PublishClusterStateAction.SEND_ACTION_NAME, + PublicationTransportHandler.PUBLISH_STATE_ACTION_NAME); } else { - masterTransportService.addFailToSendNoConnectRule(localTransportService, PublishClusterStateAction.COMMIT_ACTION_NAME); - masterTransportService.addFailToSendNoConnectRule(localTransportService, PublicationTransportHandler.COMMIT_STATE_ACTION_NAME); + masterTransportService.addFailToSendNoConnectRule(localTransportService, PublishClusterStateAction.COMMIT_ACTION_NAME, + PublicationTransportHandler.COMMIT_STATE_ACTION_NAME); } logger.info("allowing requests from non master [{}] to master [{}], waiting for two join request", nonMasterNode, masterNode);