use of com.yahoo.vdslib.state.NodeState in project vespa by vespa-engine.
the class ClusterStateGeneratorTest method do_test_storage_node_with_no_init_progress.
private String do_test_storage_node_with_no_init_progress(State wantedState) {
final ClusterFixture fixture = ClusterFixture.forFlatCluster(3).bringEntireClusterUp().reportStorageNodeState(0, new NodeState(NodeType.STORAGE, State.INITIALIZING).setInitProgress(0.5)).proposeStorageNodeWantedState(0, wantedState);
final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 0));
nodeInfo.setInitProgressTime(10_000);
final ClusterStateGenerator.Params params = fixture.generatorParams().maxInitProgressTime(1000).currentTimeInMilllis(11_000);
final AnnotatedClusterState state = ClusterStateGenerator.generatedStateFrom(params);
return state.toString();
}
use of com.yahoo.vdslib.state.NodeState in project vespa by vespa-engine.
the class ClusterStateGeneratorTest method configured_zero_init_progress_time_disables_auto_init_to_down_feature.
@Test
public void configured_zero_init_progress_time_disables_auto_init_to_down_feature() {
final ClusterFixture fixture = ClusterFixture.forFlatCluster(3).bringEntireClusterUp().reportStorageNodeState(0, new NodeState(NodeType.STORAGE, State.INITIALIZING).setInitProgress(0.5));
final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 0));
nodeInfo.setInitProgressTime(10_000);
final ClusterStateGenerator.Params params = fixture.generatorParams().maxInitProgressTime(0).currentTimeInMilllis(11_000);
final AnnotatedClusterState state = ClusterStateGenerator.generatedStateFrom(params);
assertThat(state.toString(), equalTo("distributor:3 storage:3 .0.s:i .0.i:0.5"));
}
use of com.yahoo.vdslib.state.NodeState in project vespa by vespa-engine.
the class ClusterStateGeneratorTest method distributor_nodes_in_init_mode_are_not_mapped_to_down.
@Test
public void distributor_nodes_in_init_mode_are_not_mapped_to_down() {
final NodeState initWhileListingBuckets = new NodeState(NodeType.DISTRIBUTOR, State.INITIALIZING);
initWhileListingBuckets.setInitProgress(0.0);
final ClusterFixture fixture = ClusterFixture.forFlatCluster(3).bringEntireClusterUp().reportDistributorNodeState(1, initWhileListingBuckets);
final AnnotatedClusterState state = generateFromFixtureWithDefaultParams(fixture);
assertThat(state.toString(), equalTo("distributor:3 .1.s:i .1.i:0.0 storage:3"));
}
use of com.yahoo.vdslib.state.NodeState in project vespa by vespa-engine.
the class ClusterStateGeneratorTest method non_observed_storage_node_start_timestamp_is_included_in_state.
@Test
public void non_observed_storage_node_start_timestamp_is_included_in_state() {
final NodeState nodeState = new NodeState(NodeType.STORAGE, State.UP);
// A reported state timestamp that is not yet marked as observed in the NodeInfo
// for the same node is considered not observed by other nodes and must therefore
// be included in the generated cluster state
nodeState.setStartTimestamp(5000);
final ClusterFixture fixture = ClusterFixture.forFlatCluster(5).bringEntireClusterUp().reportStorageNodeState(0, nodeState);
final AnnotatedClusterState state = generateFromFixtureWithDefaultParams(fixture);
assertThat(state.toString(), equalTo("distributor:5 storage:5 .0.t:5000"));
}
use of com.yahoo.vdslib.state.NodeState in project vespa by vespa-engine.
the class DistributionBitCountTest method testStorageNodeReportingLowerBitCount.
/**
* Test that then storage node report lower bit count, but another storage node with equally low bitcount, the fleetcontroller does nothing.
* Test that then storage node report lower bit count, and then becomes the smallest, the fleetcontroller adjusts to use that bit in system state.
*/
@Test
public void testStorageNodeReportingLowerBitCount() throws Exception {
setUpSystem("DistributionBitCountTest::testStorageNodeReportingLowerBitCount");
nodes.get(1).setNodeState(new NodeState(NodeType.STORAGE, State.UP).setMinUsedBits(13));
ClusterState currentState = waitForState("version:\\d+ bits:13 distributor:10 storage:10");
int version = currentState.getVersion();
nodes.get(3).setNodeState(new NodeState(NodeType.STORAGE, State.UP).setMinUsedBits(15));
assertEquals(version, currentState.getVersion());
nodes.get(3).setNodeState(new NodeState(NodeType.STORAGE, State.UP).setMinUsedBits(13));
assertEquals(version, currentState.getVersion());
nodes.get(3).setNodeState(new NodeState(NodeType.STORAGE, State.UP).setMinUsedBits(12));
waitForState("version:\\d+ bits:12 distributor:10 storage:10");
}
Aggregations