use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.
the class ClusterStateGeneratorTest method crash_count_not_exceeding_limit_does_not_mark_node_as_down.
@Test
public void crash_count_not_exceeding_limit_does_not_mark_node_as_down() {
final ClusterFixture fixture = ClusterFixture.forFlatCluster(5).bringEntireClusterUp();
final ClusterStateGenerator.Params params = fixture.generatorParams().maxPrematureCrashes(10);
final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 3));
// "Max crashes" range is inclusive
nodeInfo.setPrematureCrashCount(10);
final AnnotatedClusterState state = ClusterStateGenerator.generatedStateFrom(params);
assertThat(state.toString(), equalTo("distributor:5 storage:5"));
}
use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.
the class ClusterStateGeneratorTest method fully_observed_distributor_timestamp_not_included_in_state.
@Test
public void fully_observed_distributor_timestamp_not_included_in_state() {
final NodeState nodeState = new NodeState(NodeType.DISTRIBUTOR, State.UP);
nodeState.setStartTimestamp(6000);
final ClusterFixture fixture = ClusterFixture.forFlatCluster(5).bringEntireClusterUp().reportDistributorNodeState(0, nodeState);
final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.DISTRIBUTOR, 0));
nodeInfo.setStartTimestamp(6000);
final AnnotatedClusterState state = generateFromFixtureWithDefaultParams(fixture);
assertThat(state.toString(), equalTo("distributor:5 storage:5"));
}
use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.
the class ClusterStateGeneratorTest method fully_observed_storage_node_timestamp_not_included_in_state.
@Test
public void fully_observed_storage_node_timestamp_not_included_in_state() {
final NodeState nodeState = new NodeState(NodeType.STORAGE, State.UP);
nodeState.setStartTimestamp(5000);
final ClusterFixture fixture = ClusterFixture.forFlatCluster(5).bringEntireClusterUp().reportStorageNodeState(0, nodeState);
final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 0));
nodeInfo.setStartTimestamp(5000);
final AnnotatedClusterState state = generateFromFixtureWithDefaultParams(fixture);
assertThat(state.toString(), equalTo("distributor:5 storage:5"));
}
use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.
the class ClusterStateGeneratorTest method do_test_change_within_node_transition_time_window_generates_maintenance.
private void do_test_change_within_node_transition_time_window_generates_maintenance(State reportedState) {
final ClusterFixture fixture = ClusterFixture.forFlatCluster(5).bringEntireClusterUp();
final ClusterStateGenerator.Params params = fixture.generatorParams().currentTimeInMilllis(10_000).transitionTimes(2000);
fixture.reportStorageNodeState(1, reportedState);
final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 1));
// Node 1 transitioned to reported `reportedState` at time 9000ms after epoch. This means that according to the
// above transition time config, it should remain in generated maintenance mode until time 11000ms,
// at which point it should finally transition to generated state Down.
nodeInfo.setTransitionTime(9000);
{
final AnnotatedClusterState state = ClusterStateGenerator.generatedStateFrom(params);
assertThat(state.toString(), equalTo("distributor:5 storage:5 .1.s:m"));
}
nodeInfo.setTransitionTime(10999);
{
final AnnotatedClusterState state = ClusterStateGenerator.generatedStateFrom(params);
assertThat(state.toString(), equalTo("distributor:5 storage:5 .1.s:m"));
}
}
use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.
the class ClusterStateGeneratorTest method crash_count_exceeding_limit_marks_node_as_down.
@Test
public void crash_count_exceeding_limit_marks_node_as_down() {
final ClusterFixture fixture = ClusterFixture.forFlatCluster(5).bringEntireClusterUp();
final ClusterStateGenerator.Params params = fixture.generatorParams().maxPrematureCrashes(10);
final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 3));
nodeInfo.setPrematureCrashCount(11);
final AnnotatedClusterState state = ClusterStateGenerator.generatedStateFrom(params);
assertThat(state.toString(), equalTo("distributor:5 storage:5 .3.s:d"));
}
Aggregations