Search in sources :

Example 16 with Node

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());
}
Also used : Node(com.yahoo.vdslib.state.Node) Test(org.junit.Test)

Example 17 with Node

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());
}
Also used : Node(com.yahoo.vdslib.state.Node) Test(org.junit.Test)

Example 18 with Node

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());
}
Also used : Node(com.yahoo.vdslib.state.Node) Test(org.junit.Test)

Example 19 with Node

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());
}
Also used : Node(com.yahoo.vdslib.state.Node) Test(org.junit.Test)

Example 20 with Node

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());
}
Also used : Node(com.yahoo.vdslib.state.Node) Test(org.junit.Test)

Aggregations

Node (com.yahoo.vdslib.state.Node)65 Test (org.junit.Test)34 NodeState (com.yahoo.vdslib.state.NodeState)32 ConfiguredNode (com.yahoo.vdslib.distribution.ConfiguredNode)31 ClusterFixture.storageNode (com.yahoo.vespa.clustercontroller.core.ClusterFixture.storageNode)15 HasStateReasonForNode.hasStateReasonForNode (com.yahoo.vespa.clustercontroller.core.matchers.HasStateReasonForNode.hasStateReasonForNode)15 ClusterState (com.yahoo.vdslib.state.ClusterState)9 NodeInfo (com.yahoo.vespa.clustercontroller.core.NodeInfo)6 NodeType (com.yahoo.vdslib.state.NodeType)5 PrintWriter (java.io.PrintWriter)5 StringWriter (java.io.StringWriter)5 Request (com.yahoo.jrt.Request)4 State (com.yahoo.vdslib.state.State)4 IOException (java.io.IOException)4 Spec (com.yahoo.jrt.Spec)3 StringValue (com.yahoo.jrt.StringValue)3 Supervisor (com.yahoo.jrt.Supervisor)3 Target (com.yahoo.jrt.Target)3 Transport (com.yahoo.jrt.Transport)3 TreeMap (java.util.TreeMap)3