aboutsummaryrefslogtreecommitdiffstats
path: root/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller
diff options
context:
space:
mode:
authorHåkon Hallingstad <hakon@verizonmedia.com>2021-10-20 09:15:59 +0200
committerHåkon Hallingstad <hakon@verizonmedia.com>2021-10-20 09:15:59 +0200
commit1ae00585c5bd6a9af93f875ee781760d0fe88c66 (patch)
tree671245e3d046d286d75b4dbde9bed7cad43f0e98 /clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller
parent2dbd96bd9ff5e62bad6096761c58be96f2f4997b (diff)
Revert changes to config generation
Diffstat (limited to 'clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller')
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterFeedBlockTest.java3
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/DistributionBitCountTest.java9
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/GroupAutoTakedownLiveConfigTest.java5
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/MasterElectionTest.java4
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/NodeSlobrokConfigurationMembershipTest.java6
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/RpcServerTest.java10
6 files changed, 21 insertions, 16 deletions
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterFeedBlockTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterFeedBlockTest.java
index a52370a0654..7c4e05aa0e9 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterFeedBlockTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterFeedBlockTest.java
@@ -135,7 +135,8 @@ public class ClusterFeedBlockTest extends FleetControllerTest {
assertTrue(ctrl.getClusterStateBundle().clusterFeedIsBlocked());
// Increase cheese allowance. Should now automatically unblock since reported usage is lower.
- ctrl.updateOptions(createOptions(mapOf(usage("cheese", 0.9), usage("wine", 0.4))));
+ int dummyConfigGeneration = 2;
+ ctrl.updateOptions(createOptions(mapOf(usage("cheese", 0.9), usage("wine", 0.4))), dummyConfigGeneration);
ctrl.tick(); // Options propagation
ctrl.tick(); // State recomputation
assertFalse(ctrl.getClusterStateBundle().clusterFeedIsBlocked());
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/DistributionBitCountTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/DistributionBitCountTest.java
index e8f20a00d24..e38e48375ed 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/DistributionBitCountTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/DistributionBitCountTest.java
@@ -7,11 +7,12 @@ import com.yahoo.vdslib.state.NodeState;
import com.yahoo.vdslib.state.NodeType;
import com.yahoo.vdslib.state.State;
import org.junit.Test;
-import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
+import static org.junit.Assert.assertEquals;
+
public class DistributionBitCountTest extends FleetControllerTest {
private void setUpSystem(String testName) throws Exception {
@@ -39,12 +40,12 @@ public class DistributionBitCountTest extends FleetControllerTest {
public void testDistributionBitCountConfigIncrease() throws Exception {
setUpSystem("DistributionBitCountTest::testDistributionBitCountConfigIncrease");
options.distributionBits = 20;
- fleetController.updateOptions(options);
+ fleetController.updateOptions(options, 0);
ClusterState currentState = waitForState("version:\\d+ bits:20 distributor:10 storage:10");
int version = currentState.getVersion();
options.distributionBits = 23;
- fleetController.updateOptions(options);
+ fleetController.updateOptions(options, 0);
assertEquals(version, currentState.getVersion());
}
@@ -55,7 +56,7 @@ public class DistributionBitCountTest extends FleetControllerTest {
public void testDistributionBitCountConfigDecrease() throws Exception {
setUpSystem("DistributionBitCountTest::testDistributionBitCountConfigDecrease");
options.distributionBits = 12;
- fleetController.updateOptions(options);
+ fleetController.updateOptions(options, 0);
waitForState("version:\\d+ bits:12 distributor:10 storage:10");
}
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/GroupAutoTakedownLiveConfigTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/GroupAutoTakedownLiveConfigTest.java
index e6c5c31010f..77bcff1e7d5 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/GroupAutoTakedownLiveConfigTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/GroupAutoTakedownLiveConfigTest.java
@@ -9,6 +9,8 @@ import static org.junit.Assert.assertFalse;
public class GroupAutoTakedownLiveConfigTest extends FleetControllerTest {
+ private long mockConfigGeneration = 1;
+
private static FleetControllerOptions createOptions(DistributionBuilder.GroupBuilder groupBuilder, double minNodeRatio) {
FleetControllerOptions options = defaultOptions("mycluster");
options.setStorageDistribution(DistributionBuilder.forHierarchicCluster(groupBuilder));
@@ -19,7 +21,8 @@ public class GroupAutoTakedownLiveConfigTest extends FleetControllerTest {
}
private void updateConfigLive(FleetControllerOptions newOptions) {
- this.fleetController.updateOptions(newOptions);
+ ++mockConfigGeneration;
+ this.fleetController.updateOptions(newOptions, mockConfigGeneration);
}
private void reconfigureWithMinNodeRatio(double minNodeRatio) {
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/MasterElectionTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/MasterElectionTest.java
index bf3efb17ddf..0599baf7c7a 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/MasterElectionTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/MasterElectionTest.java
@@ -296,7 +296,7 @@ public class MasterElectionTest extends FleetControllerTest {
for (FleetController fc : fleetControllers) {
FleetControllerOptions myoptions = fc.getOptions();
myoptions.zooKeeperServerAddress = zooKeeperServer.getAddress();
- fc.updateOptions(myoptions);
+ fc.updateOptions(myoptions, 0);
log.log(Level.INFO, "Should now have sent out new zookeeper server address " + myoptions.zooKeeperServerAddress + " to fleetcontroller " + myoptions.fleetControllerIndex);
}
timer.advanceTime(10 * 1000); // Wait long enough for fleetcontroller wanting to retry zookeeper connection
@@ -447,7 +447,7 @@ public class MasterElectionTest extends FleetControllerTest {
FleetControllerOptions newOptions = options.clone();
for (int i=0; i<fleetControllers.size(); ++i) {
FleetControllerOptions nodeOptions = adjustConfig(newOptions, i, fleetControllers.size());
- fleetControllers.get(i).updateOptions(nodeOptions);
+ fleetControllers.get(i).updateOptions(nodeOptions, 2);
}
waitForMaster(0);
log.log(Level.INFO, "SHUTTING DOWN FLEET CONTROLLER 0");
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/NodeSlobrokConfigurationMembershipTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/NodeSlobrokConfigurationMembershipTest.java
index ea539cc13e0..c1f1d0e1bc1 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/NodeSlobrokConfigurationMembershipTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/NodeSlobrokConfigurationMembershipTest.java
@@ -46,7 +46,7 @@ public class NodeSlobrokConfigurationMembershipTest extends FleetControllerTest
// cluster. If we do not re-fetch state from slobrok we risk racing
nodeIndices.add(foreignNode);
options.nodes = asConfiguredNodes(nodeIndices);
- fleetController.updateOptions(options);
+ fleetController.updateOptions(options, 0);
// Need to treat cluster as having 6 nodes due to ideal state algo semantics.
// Note that we do not use subsetWaiter here since we want node 6 included.
waitForState("version:\\d+ distributor:7 .4.s:d .5.s:d storage:7 .4.s:d .5.s:d");
@@ -65,13 +65,13 @@ public class NodeSlobrokConfigurationMembershipTest extends FleetControllerTest
assertTrue(configuredNodes.remove(new ConfiguredNode(0, false)));
configuredNodes.add(new ConfiguredNode(0, true));
options.nodes = configuredNodes;
- fleetController.updateOptions(options);
+ fleetController.updateOptions(options, 0);
waitForState("version:\\d+ distributor:4 storage:4 .0.s:r");
// Now remove the retired node entirely from config
assertTrue(configuredNodes.remove(new ConfiguredNode(0, true)));
- fleetController.updateOptions(options);
+ fleetController.updateOptions(options, 0);
// The previously retired node should now be marked as down, as it no longer
// exists from the point of view of the content cluster. We have to use a subset
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/RpcServerTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/RpcServerTest.java
index fee1d33725c..05ee96500d5 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/RpcServerTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/RpcServerTest.java
@@ -346,7 +346,7 @@ public class RpcServerTest extends FleetControllerTest {
options.slobrokConnectionSpecs = this.options.slobrokConnectionSpecs;
this.options.maxInitProgressTime = 30000;
this.options.stableStateTimePeriod = 60000;
- fleetController.updateOptions(options);
+ fleetController.updateOptions(options, 0);
waitForState("version:\\d+ distributor:7 storage:7 .0.s:m .1.s:m .2.s:r .3.s:r .4.s:r");
}
@@ -376,7 +376,7 @@ public class RpcServerTest extends FleetControllerTest {
options.slobrokConnectionSpecs = this.options.slobrokConnectionSpecs;
this.options.maxInitProgressTime = 30000;
this.options.stableStateTimePeriod = 60000;
- fleetController.updateOptions(options);
+ fleetController.updateOptions(options, 0);
waitForState("version:\\d+ distributor:7 storage:7 .0.s:m .1.s:m");
}
@@ -415,7 +415,7 @@ public class RpcServerTest extends FleetControllerTest {
options.slobrokConnectionSpecs = this.options.slobrokConnectionSpecs;
this.options.maxInitProgressTime = 30000;
this.options.stableStateTimePeriod = 60000;
- fleetController.updateOptions(options);
+ fleetController.updateOptions(options, 0);
waitForState("version:\\d+ distributor:5 storage:5");
}
@@ -430,7 +430,7 @@ public class RpcServerTest extends FleetControllerTest {
options.slobrokConnectionSpecs = this.options.slobrokConnectionSpecs;
this.options.maxInitProgressTime = 30000;
this.options.stableStateTimePeriod = 60000;
- fleetController.updateOptions(options);
+ fleetController.updateOptions(options, 0);
waitForState("version:\\d+ distributor:7 storage:7 .0.s:r .1.s:r .2.s:r .3.s:r .4.s:r");
}
@@ -444,7 +444,7 @@ public class RpcServerTest extends FleetControllerTest {
options.slobrokConnectionSpecs = this.options.slobrokConnectionSpecs;
this.options.maxInitProgressTime = 30000;
this.options.stableStateTimePeriod = 60000;
- fleetController.updateOptions(options);
+ fleetController.updateOptions(options, 0);
waitForState("version:\\d+ distributor:7 storage:7 .0.s:r .1.s:r .2.s:r .3.s:r .4.s:r");
}