aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2019-03-08 12:58:31 +0100
committerTor Brede Vekterli <vekterli@verizonmedia.com>2019-03-14 14:43:03 +0000
commit57b4604fc462cdc18e00bfd425a2211fac429869 (patch)
tree9797e52a497b001d89cc197b320b1deecda6b236 /clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java
parent05f27f6cfcda786232fa6da47154784dce2483e1 (diff)
Support configurable two-phase state transitions in cluster controller
Diffstat (limited to 'clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java')
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java
index 32de3591f2d..85106ce7e3c 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java
@@ -171,6 +171,9 @@ public class StateChangeTest extends FleetControllerTest {
options.nodeStateRequestTimeoutMS = 60 * 60 * 1000;
options.minTimeBetweenNewSystemStates = 0;
options.maxInitProgressTime = 50000;
+ // This test makes very specific assumptions about the amount of work done in a single tick.
+ // Two-phase cluster state activation changes this quite a bit, so disable it. At least for now.
+ options.enableTwoPhaseClusterStateActivation = false;
initialize(options);
@@ -1035,7 +1038,7 @@ public class StateChangeTest extends FleetControllerTest {
// Assert that the failed node has not acknowledged the latest version.
// (The version may still be larger than versionBeforeChange if the fleet controller sends a
// "stable system" update without timestamps in the meantime
- assertTrue(fleetController.getCluster().getNodeInfo(nodes.get(1).getNode()).getSystemStateVersionAcknowledged() < versionAfterChange);
+ assertTrue(fleetController.getCluster().getNodeInfo(nodes.get(1).getNode()).getClusterStateVersionBundleAcknowledged() < versionAfterChange);
// Ensure non-concurrent access to getNewestSystemStateVersionSent
synchronized(timer) {
@@ -1343,11 +1346,19 @@ public class StateChangeTest extends FleetControllerTest {
void sendAllDeferredDistributorClusterStateAcks() throws Exception {
communicator.sendAllDeferredDistributorClusterStateAcks();
- ctrl.tick();
+ ctrl.tick(); // Process cluster state bundle ACKs
+ if (ctrl.getOptions().enableTwoPhaseClusterStateActivation) {
+ ctrl.tick(); // Send activations
+ ctrl.tick(); // Process activation ACKs
+ }
}
void processScheduledTask() throws Exception {
ctrl.tick(); // Cluster state recompute iteration and send
+ if (ctrl.getOptions().enableTwoPhaseClusterStateActivation) {
+ ctrl.tick(); // Send activations
+ ctrl.tick(); // Process activation ACKs
+ }
ctrl.tick(); // Iff ACKs were received, process version dependent task(s)
}
@@ -1440,7 +1451,7 @@ public class StateChangeTest extends FleetControllerTest {
@Test
public void no_op_synchronous_remote_task_waits_until_current_state_is_acked() throws Exception {
- RemoteTaskFixture fixture = createFixtureWith(optionsWithZeroTransitionTime());
+ RemoteTaskFixture fixture = createFixtureWith(optionsWithZeroTransitionTime());
communicator.setShouldDeferDistributorClusterStateAcks(true);
fixture.markStorageNodeDown(0);
@@ -1523,7 +1534,9 @@ public class StateChangeTest extends FleetControllerTest {
public void cluster_state_ack_is_not_dependent_on_state_send_grace_period() throws Exception {
FleetControllerOptions options = defaultOptions();
options.minTimeBetweenNewSystemStates = 10_000;
+ //options.enableTwoPhaseClusterStateActivation = false; ////
RemoteTaskFixture fixture = createFixtureWith(options);
+
// Have to increment timer here to be able to send state generated by the scheduled task
timer.advanceTime(10_000);