diff options
author | Tor Brede Vekterli <vekterli@yahoo-inc.com> | 2017-05-12 14:22:26 +0200 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahoo-inc.com> | 2017-05-12 14:38:36 +0200 |
commit | 1a17bb806379046a6ef513c3ef05e45d65028e19 (patch) | |
tree | 96bbdf3c26c9c375cd181cc1974bd55ff35e3b93 /clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/WantedStateTest.java | |
parent | d25a365c86303637ae6db9a25d3149f87121ca83 (diff) |
Always write new cluster state versions to ZooKeeper
Previously, the controller would not write the version to ZK unless the
version was published to at least one node. This could lead to problems
due to un-written version numbers being visible via the controller's REST
APIs. External observers could see versions that were not present in ZK
and that would not be stable across reelections. As a consequence, invariants
for strictly increasing version numbers would be violated from the
perspective of these external observers (in particular, our system test
framework).
Diffstat (limited to 'clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/WantedStateTest.java')
-rw-r--r-- | clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/WantedStateTest.java | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/WantedStateTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/WantedStateTest.java index 3c4084d304c..9c928262321 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/WantedStateTest.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/WantedStateTest.java @@ -1,50 +1,12 @@ // Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. package com.yahoo.vespa.clustercontroller.core; -import com.yahoo.jrt.*; -import com.yahoo.jrt.StringValue; -import com.yahoo.vdslib.state.NodeState; import com.yahoo.vdslib.state.State; -import org.junit.After; -import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertTrue; public class WantedStateTest extends FleetControllerTest { - private Supervisor supervisor; - - @Before - public void setUp() { - supervisor = new Supervisor(new Transport()); - } - - @After - public void tearDown() throws Exception { - if (supervisor != null) { - supervisor.transport().shutdown().join(); - supervisor = null; - } - super.tearDown(); - } - - public void setWantedState(DummyVdsNode node, State state, String reason) { - NodeState ns = new NodeState(node.getType(), state); - if (reason != null) ns.setDescription(reason); - Target connection = supervisor.connect(new Spec("localhost", fleetController.getRpcPort())); - Request req = new Request("setNodeState"); - req.parameters().add(new StringValue(node.getSlobrokName())); - req.parameters().add(new StringValue(ns.serialize())); - connection.invokeSync(req, timeoutS); - if (req.isError()) { - assertTrue("Failed to invoke setNodeState(): " + req.errorCode() + ": " + req.errorMessage(), false); - } - if (!req.checkReturnTypes("s")) { - assertTrue("Failed to invoke setNodeState(): Invalid return types.", false); - } - } - @Test public void testSettingStorageNodeMaintenanceAndBack() throws Exception { startingTest("WantedStateTest::testSettingStorageNodeMaintenanceAndBack()"); |