diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2021-03-11 16:50:08 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2021-03-11 16:50:08 +0100 |
commit | 0916a5a1ac78a0ade76a86dee551ab2583a4ab4a (patch) | |
tree | 95b614550c7b1c3e76e420195438ce8ff3e328b3 /clustercontroller-core/src/test/java/com/yahoo | |
parent | 9f67253858a7ffaf452f6f8d456bf8b73e103dd6 (diff) |
GC use of void DiskState.
Diffstat (limited to 'clustercontroller-core/src/test/java/com/yahoo')
3 files changed, 0 insertions, 63 deletions
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStateGeneratorTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStateGeneratorTest.java index 01b5cbb8e59..bf191768892 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStateGeneratorTest.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ClusterStateGeneratorTest.java @@ -73,20 +73,6 @@ public class ClusterStateGeneratorTest { } @Test - public void storage_reported_disk_state_included_in_generated_state() { - final NodeState stateWithDisks = new NodeState(NodeType.STORAGE, State.UP); - stateWithDisks.setDiskCount(7); - stateWithDisks.setDiskState(5, new DiskState(State.DOWN)); - - final ClusterFixture fixture = ClusterFixture.forFlatCluster(9) - .bringEntireClusterUp() - .reportStorageNodeState(2, stateWithDisks); - final AnnotatedClusterState state = generateFromFixtureWithDefaultParams(fixture); - - assertThat(state.toString(), equalTo("distributor:9 storage:9 .2.d:7 .2.d.5.s:d")); - } - - @Test public void worse_distributor_wanted_state_overrides_reported_state() { // Maintenance mode is illegal for distributors and therefore not tested final ClusterFixture fixture = ClusterFixture.forFlatCluster(7) @@ -245,33 +231,6 @@ public class ClusterStateGeneratorTest { } @Test - public void reported_disk_state_not_hidden_by_wanted_state() { - final NodeState stateWithDisks = new NodeState(NodeType.STORAGE, State.UP); - stateWithDisks.setDiskCount(5); - stateWithDisks.setDiskState(3, new DiskState(State.DOWN)); - - final ClusterFixture fixture = ClusterFixture.forFlatCluster(9) - .bringEntireClusterUp() - .reportStorageNodeState(2, stateWithDisks) - .proposeStorageNodeWantedState(2, State.RETIRED) - .reportStorageNodeState(3, stateWithDisks) - .proposeStorageNodeWantedState(3, State.MAINTENANCE); - final AnnotatedClusterState state = generateFromFixtureWithDefaultParams(fixture); - - // We do not publish disk states for nodes in Down state. This differs from how the - // legacy controller did things, but such states cannot be counted on for ideal state - // calculations either way. In particular, reported disk states are not persisted and - // only exist transiently in the cluster controller's memory. A controller restart is - // sufficient to clear all disk states that have been incidentally remembered for now - // downed nodes. - // The keen reader may choose to convince themselves of this independently by reading the - // code in com.yahoo.vdslib.distribution.Distribution#getIdealStorageNodes and observing - // how disk states for nodes that are in a down-state are never considered. - assertThat(state.toString(), equalTo("distributor:9 storage:9 .2.s:r .2.d:5 .2.d.3.s:d " + - ".3.s:m .3.d:5 .3.d.3.s:d")); - } - - @Test public void config_retired_mode_is_reflected_in_generated_state() { ClusterFixture fixture = ClusterFixture.forFlatCluster(5) .markNodeAsConfigRetired(2) diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/GroupAutoTakedownTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/GroupAutoTakedownTest.java index a632ec62dc7..bd77f42ff8a 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/GroupAutoTakedownTest.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/GroupAutoTakedownTest.java @@ -279,25 +279,6 @@ public class GroupAutoTakedownTest { } @Test - public void disk_states_are_preserved_across_group_down_up_edge() { - ClusterFixture fixture = createFixtureForAllUpHierarchicCluster( - DistributionBuilder.withGroups(3).eachWithNodeCount(2), 0.51); - - final NodeState newState = new NodeState(NodeType.STORAGE, State.UP); - newState.setDiskCount(7); - newState.setDiskState(5, new DiskState(State.DOWN)); - - fixture.reportStorageNodeState(4, newState); - - assertEquals("distributor:6 storage:6 .4.d:7 .4.d.5.s:d", fixture.generatedClusterState()); - - assertEquals("distributor:6 storage:4", - stateAfterStorageTransition(fixture, 5, State.DOWN)); - assertEquals("distributor:6 storage:6 .4.d:7 .4.d.5.s:d", - stateAfterStorageTransition(fixture, 5, State.UP)); - } - - @Test public void down_wanted_state_is_preserved_across_group_down_up_edge() { ClusterFixture fixture = createFixtureForAllUpHierarchicCluster( DistributionBuilder.withGroups(3).eachWithNodeCount(3), 0.60); diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/restapiv2/StateRestApiTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/restapiv2/StateRestApiTest.java index 1b900310d46..14eab503885 100644 --- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/restapiv2/StateRestApiTest.java +++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/restapiv2/StateRestApiTest.java @@ -120,9 +120,6 @@ public abstract class StateRestApiTest { for (ConfiguredNode configuredNode : nodes) { for (NodeType type : NodeType.getTypes()) { NodeState reported = new NodeState(type, State.UP); - if (type.equals(NodeType.STORAGE)) { - reported.setDiskCount(2); - } NodeInfo nodeInfo = cluster.clusterInfo().setRpcAddress(new Node(type, configuredNode.index()), "rpc:" + type + "/" + configuredNode); nodeInfo.setReportedState(reported, 10); |