aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahoo-inc.com>2017-09-12 15:09:43 +0200
committerTor Brede Vekterli <vekterli@yahoo-inc.com>2017-09-12 15:09:43 +0200
commitf9fa1cc6d50aedb47cd80cb8ded9c34fe338532f (patch)
treeb0cf74a84c41e17106072ba30777bbe394ede5db /clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java
parent96d3f5543a9ec7926a30411e8ab0dcb34cc56eb8 (diff)
Break node version ACK check out into separately called logic
Removes dependency on having to invoke broadcastNewState before being able to observe that all distributors are in sync. Invocations of broadcastNewState are gated by a grace period between each time, so unless this is done we get artificial delays before a synchronous task can be considered complete.
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, 19 insertions, 0 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 a452a85c870..e4898d82314 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
@@ -1489,4 +1489,23 @@ public class StateChangeTest extends FleetControllerTest {
assertTrue(task.isLeadershipLost());
}
+ @Test
+ public void cluster_state_ack_is_not_dependent_on_state_send_grace_period() throws Exception {
+ FleetControllerOptions options = defaultOptions();
+ options.minTimeBetweenNewSystemStates = 10_000;
+ RemoteTaskFixture fixture = createFixtureWith(options);
+ // Have to increment timer here to be able to send state generated by the scheduled task
+ timer.advanceTime(10_000);
+
+ MockTask task = fixture.scheduleNonIdempotentVersionDependentTask();
+ communicator.setShouldDeferDistributorClusterStateAcks(true);
+ fixture.processScheduledTask();
+ assertFalse(task.isCompleted()); // Not yet acked by all nodes
+ // If tracking whether ACKs are received from the cluster is dependent on the system state
+ // send grace period, we won't observe that the task may be completed even though all nodes
+ // have ACKed. Would then have to increment timer by 10s and do another tick.
+ fixture.sendAllDeferredDistributorClusterStateAcks();
+ assertTrue(task.isCompleted());
+ }
+
}