use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.
the class NodeInfoTest method down_wanted_state_overrides_config_retired_state.
@Test
public void down_wanted_state_overrides_config_retired_state() {
ClusterFixture fixture = ClusterFixture.forFlatCluster(3).markNodeAsConfigRetired(1).proposeStorageNodeWantedState(1, State.DOWN);
NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 1));
assertEquals(State.DOWN, nodeInfo.getWantedState().getState());
}
use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.
the class NodeInfoTest method zeroing_crash_count_resets_unstable_init_flag.
/**
* The cluster controller will, after a time of observed stable state, reset the crash
* counter for a given node. This should also reset the unstable init flag to keep it
* from haunting a now stable node.
*/
@Test
public void zeroing_crash_count_resets_unstable_init_flag() {
ClusterFixture fixture = fixtureWithNodeMarkedAsUnstableInit(1);
final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 1));
nodeInfo.setPrematureCrashCount(0);
assertFalse(nodeInfo.recentlyObservedUnstableDuringInit());
}
use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.
the class NodeInfoTest method non_zero_crash_count_update_does_not_reset_unstable_init_flag.
/**
* A non-zero crash count update, on the other hand, implies the node is suffering
* further instabilities and should not clear the unstable init flag.
*/
@Test
public void non_zero_crash_count_update_does_not_reset_unstable_init_flag() {
ClusterFixture fixture = fixtureWithNodeMarkedAsUnstableInit(1);
final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 1));
nodeInfo.setPrematureCrashCount(3);
assertTrue(nodeInfo.recentlyObservedUnstableDuringInit());
}
use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.
the class NodeInfoTest method down_edge_during_init_state_marks_as_unstable_init.
@Test
public void down_edge_during_init_state_marks_as_unstable_init() {
ClusterFixture fixture = fixtureWithNodeMarkedAsUnstableInit(1);
final NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 1));
assertTrue(nodeInfo.recentlyObservedUnstableDuringInit());
}
use of com.yahoo.vdslib.state.Node in project vespa by vespa-engine.
the class NodeInfoTest method retired_state_overrides_default_up_wanted_state.
@Test
public void retired_state_overrides_default_up_wanted_state() {
final ClusterFixture fixture = ClusterFixture.forFlatCluster(3).markNodeAsConfigRetired(1);
NodeInfo nodeInfo = fixture.cluster.getNodeInfo(new Node(NodeType.STORAGE, 1));
assertEquals(State.RETIRED, nodeInfo.getWantedState().getState());
}
Aggregations