summaryrefslogtreecommitdiffstats
path: root/clustercontroller-core
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@yahoo-inc.com>2017-09-12 16:19:52 +0200
committerTor Brede Vekterli <vekterli@yahoo-inc.com>2017-09-12 16:19:52 +0200
commit9a504adf522c0bb550aa39ae3dd4601a67278b97 (patch)
tree11a419641316e0a832445c79dc170095c43ec556 /clustercontroller-core
parent7d4a7e6bea526a4550c9cd679665a07eaaffe638 (diff)
Change wording for operations without observable side-effects
Diffstat (limited to 'clustercontroller-core')
-rw-r--r--clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java9
-rw-r--r--clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/RemoteClusterControllerTask.java2
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/StateChangeTest.java34
3 files changed, 23 insertions, 22 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java
index 69e3a9f2886..cff54988342 100644
--- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java
+++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java
@@ -784,10 +784,11 @@ public class FleetController implements NodeStateOrHostInfoChangeHandler, NodeAd
* has been ACKed by all distributors in the system, those tasks will be marked as completed.
*
* This works transparently for tasks that end up changing the current cluster state (i.e.
- * requiring a new state to be published) and for those whose changes are idempotent. In the
- * former case the tasks will depend on the version that was generated based upon them. In
- * the latter case the tasks will depend on the version that is already published (or in the
- * process of being published).
+ * requiring a new state to be published) and for those whose changes are no-ops (because
+ * the changes they request are already part of the current state). In the former case the
+ * tasks will depend on the version that was generated based upon them. In the latter case
+ * the tasks will depend on the version that is already published (or in the process of
+ * being published).
*/
private void scheduleVersionDependentTasksForFutureCompletion() {
for (RemoteClusterControllerTask task : tasksPendingStateRecompute) {
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/RemoteClusterControllerTask.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/RemoteClusterControllerTask.java
index 0e20410ce77..0fb9e5798c8 100644
--- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/RemoteClusterControllerTask.java
+++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/RemoteClusterControllerTask.java
@@ -25,7 +25,7 @@ public abstract class RemoteClusterControllerTask {
* version representing the changes made by the task has been ACKed by
* all distributors.
*
- * Note that if a task performs an idempotent state change (e.g. setting maintenance
+ * Note that if a task performs a no-op state change (e.g. setting maintenance
* mode on a node already in maintenance mode), the task may be considered complete
* immediately if its effective changes have already been ACKed.
*/
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 e4898d82314..49cfe8bd3b6 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
@@ -1263,7 +1263,7 @@ public class StateChangeTest extends FleetControllerTest {
// We create an explicit mock task class instead of using mock() simply because of
// the utter pain that mocking void functions (doRemoteFleetControllerTask()) is
// when using Mockito.
- private static class MockSynchronousTask extends MockTask {
+ private static class MockSynchronousTaskWithSideEffects extends MockTask {
@Override
public void doRemoteFleetControllerTask(Context ctx) {
// Trigger a state transition edge that requires a state to be published and ACKed
@@ -1275,7 +1275,7 @@ public class StateChangeTest extends FleetControllerTest {
}
}
- private static class MockIdempotentSynchronousTask extends MockTask {
+ private static class MockNoOpSynchronousTask extends MockTask {
@Override
public void doRemoteFleetControllerTask(Context ctx) {
// Tests scheduling this task shall have ensured that node storage.0 already is DOWN,
@@ -1302,12 +1302,12 @@ public class StateChangeTest extends FleetControllerTest {
return task;
}
- MockTask scheduleNonIdempotentVersionDependentTask() throws Exception {
- return scheduleTask(new MockSynchronousTask());
+ MockTask scheduleVersionDependentTaskWithSideEffects() throws Exception {
+ return scheduleTask(new MockSynchronousTaskWithSideEffects());
}
- MockTask scheduleIdempotentVersionDependentTask() throws Exception {
- return scheduleTask(new MockIdempotentSynchronousTask());
+ MockTask scheduleNoOpVersionDependentTask() throws Exception {
+ return scheduleTask(new MockNoOpSynchronousTask());
}
void markStorageNodeDown(int index) throws Exception {
@@ -1379,7 +1379,7 @@ public class StateChangeTest extends FleetControllerTest {
@Test
public void synchronous_remote_task_is_completed_when_state_is_acked_by_cluster() throws Exception {
RemoteTaskFixture fixture = createDefaultFixture();
- MockTask task = fixture.scheduleNonIdempotentVersionDependentTask();
+ MockTask task = fixture.scheduleVersionDependentTaskWithSideEffects();
assertTrue(task.isInvoked());
assertFalse(task.isCompleted());
@@ -1396,10 +1396,10 @@ public class StateChangeTest extends FleetControllerTest {
}
@Test
- public void idempotent_synchronous_remote_task_can_complete_immediately_if_current_state_already_acked() throws Exception {
+ public void no_op_synchronous_remote_task_can_complete_immediately_if_current_state_already_acked() throws Exception {
RemoteTaskFixture fixture = createFixtureWith(optionsWithZeroTransitionTime());
fixture.markStorageNodeDown(0);
- MockTask task = fixture.scheduleIdempotentVersionDependentTask(); // Tries to set node 0 into Down; already in that state
+ MockTask task = fixture.scheduleNoOpVersionDependentTask(); // Tries to set node 0 into Down; already in that state
assertTrue(task.isInvoked());
assertFalse(task.isCompleted());
@@ -1409,12 +1409,12 @@ public class StateChangeTest extends FleetControllerTest {
}
@Test
- public void idempotent_synchronous_remote_task_waits_until_current_state_is_acked() throws Exception {
+ public void no_op_synchronous_remote_task_waits_until_current_state_is_acked() throws Exception {
RemoteTaskFixture fixture = createFixtureWith(optionsWithZeroTransitionTime());
communicator.setShouldDeferDistributorClusterStateAcks(true);
fixture.markStorageNodeDown(0);
- MockTask task = fixture.scheduleIdempotentVersionDependentTask(); // Tries to set node 0 into Down; already in that state
+ MockTask task = fixture.scheduleNoOpVersionDependentTask(); // Tries to set node 0 into Down; already in that state
assertTrue(task.isInvoked());
assertFalse(task.isCompleted());
@@ -1430,14 +1430,14 @@ public class StateChangeTest extends FleetControllerTest {
// When the cluster is down no intermediate states will be published to the nodes
// unless the state triggers a cluster Up edge. To avoid hanging task responses
// for an indeterminate amount of time in this scenario, we effectively treat
- // tasks running in such a context as if they were idempotent. I.e. we only require
+ // tasks running in such a context as if they were no-ops. I.e. we only require
// the cluster down-state to have been published.
@Test
public void immediately_complete_sync_remote_task_when_cluster_is_down() throws Exception {
RemoteTaskFixture fixture = createFixtureWith(optionsAllowingZeroNodesDown());
// Controller options require 10/10 nodes up, so take one down to trigger a cluster Down edge.
fixture.markStorageNodeDown(1);
- MockTask task = fixture.scheduleNonIdempotentVersionDependentTask();
+ MockTask task = fixture.scheduleVersionDependentTaskWithSideEffects();
assertTrue(task.isInvoked());
assertFalse(task.isCompleted());
@@ -1451,8 +1451,8 @@ public class StateChangeTest extends FleetControllerTest {
RemoteTaskFixture fixture = createDefaultFixture();
communicator.setShouldDeferDistributorClusterStateAcks(true);
- MockTask task1 = fixture.scheduleNonIdempotentVersionDependentTask();
- MockTask task2 = fixture.scheduleNonIdempotentVersionDependentTask();
+ MockTask task1 = fixture.scheduleVersionDependentTaskWithSideEffects();
+ MockTask task2 = fixture.scheduleVersionDependentTaskWithSideEffects();
fixture.processScheduledTask();
assertFalse(task1.isCompleted());
@@ -1473,7 +1473,7 @@ public class StateChangeTest extends FleetControllerTest {
fixture.winLeadership();
markAllNodesAsUp(options);
- MockTask task = fixture.scheduleNonIdempotentVersionDependentTask();
+ MockTask task = fixture.scheduleVersionDependentTaskWithSideEffects();
assertTrue(task.isInvoked());
assertFalse(task.isCompleted());
@@ -1497,7 +1497,7 @@ public class StateChangeTest extends FleetControllerTest {
// Have to increment timer here to be able to send state generated by the scheduled task
timer.advanceTime(10_000);
- MockTask task = fixture.scheduleNonIdempotentVersionDependentTask();
+ MockTask task = fixture.scheduleVersionDependentTaskWithSideEffects();
communicator.setShouldDeferDistributorClusterStateAcks(true);
fixture.processScheduledTask();
assertFalse(task.isCompleted()); // Not yet acked by all nodes