Search in sources :

Example 6 with ConfiguredNode

use of com.yahoo.vdslib.distribution.ConfiguredNode in project vespa by vespa-engine.

the class ClusterFixture method forHierarchicCluster.

public static ClusterFixture forHierarchicCluster(DistributionBuilder.GroupBuilder root) {
    List<ConfiguredNode> nodes = DistributionBuilder.buildConfiguredNodes(root.totalNodeCount());
    Distribution distribution = DistributionBuilder.forHierarchicCluster(root);
    ContentCluster cluster = new ContentCluster("foo", nodes, distribution, 0, 0.0);
    return new ClusterFixture(cluster, distribution);
}
Also used : ConfiguredNode(com.yahoo.vdslib.distribution.ConfiguredNode) Distribution(com.yahoo.vdslib.distribution.Distribution)

Example 7 with ConfiguredNode

use of com.yahoo.vdslib.distribution.ConfiguredNode in project vespa by vespa-engine.

the class ClusterFixture method forFlatCluster.

public static ClusterFixture forFlatCluster(int nodeCount) {
    Collection<ConfiguredNode> nodes = DistributionBuilder.buildConfiguredNodes(nodeCount);
    Distribution distribution = DistributionBuilder.forFlatCluster(nodeCount);
    ContentCluster cluster = new ContentCluster("foo", nodes, distribution, 0, 0.0);
    return new ClusterFixture(cluster, distribution);
}
Also used : ConfiguredNode(com.yahoo.vdslib.distribution.ConfiguredNode) Distribution(com.yahoo.vdslib.distribution.Distribution)

Example 8 with ConfiguredNode

use of com.yahoo.vdslib.distribution.ConfiguredNode in project vespa by vespa-engine.

the class EventDiffCalculator method emitPerNodeDiffEvents.

private static void emitPerNodeDiffEvents(final PerStateParams params, final List<Event> events) {
    final ContentCluster cluster = params.cluster;
    final ClusterState fromState = params.fromState.getClusterState();
    final ClusterState toState = params.toState.getClusterState();
    for (ConfiguredNode node : cluster.getConfiguredNodes().values()) {
        for (NodeType nodeType : NodeType.getTypes()) {
            final Node n = new Node(nodeType, node.index());
            emitSingleNodeEvents(params, events, cluster, fromState, toState, n);
        }
    }
}
Also used : ClusterState(com.yahoo.vdslib.state.ClusterState) ConfiguredNode(com.yahoo.vdslib.distribution.ConfiguredNode) NodeType(com.yahoo.vdslib.state.NodeType) ConfiguredNode(com.yahoo.vdslib.distribution.ConfiguredNode) Node(com.yahoo.vdslib.state.Node)

Example 9 with ConfiguredNode

use of com.yahoo.vdslib.distribution.ConfiguredNode in project vespa by vespa-engine.

the class NodeSlobrokConfigurationMembershipTest method test_removed_retired_node_is_not_included_in_state.

@Test
public void test_removed_retired_node_is_not_included_in_state() throws Exception {
    final Set<ConfiguredNode> configuredNodes = asConfiguredNodes(nodeIndices);
    FleetControllerOptions options = optionsForConfiguredNodes(configuredNodes);
    setUpFleetController(true, options);
    setUpVdsNodes(true, new DummyVdsNodeOptions(), false, nodeIndices);
    waitForState("version:\\d+ distributor:4 storage:4");
    // Update options with 1 node config-retired
    assertTrue(configuredNodes.remove(new ConfiguredNode(0, false)));
    configuredNodes.add(new ConfiguredNode(0, true));
    options.nodes = configuredNodes;
    fleetController.updateOptions(options, 0);
    waitForState("version:\\d+ distributor:4 storage:4 .0.s:r");
    // Now remove the retired node entirely from config
    assertTrue(configuredNodes.remove(new ConfiguredNode(0, true)));
    fleetController.updateOptions(options, 0);
    // The previously retired node should now be marked as down, as it no longer
    // exists from the point of view of the content cluster. We have to use a subset
    // state waiter, as the controller will not send the new state to node 0.
    waitForStateExcludingNodeSubset("version:\\d+ distributor:4 .0.s:d storage:4 .0.s:d", asIntSet(0));
    // Ensure it remains down for subsequent cluster state versions as well.
    nodes.get(3).disconnect();
    waitForStateExcludingNodeSubset("version:\\d+ distributor:4 .0.s:d storage:4 .0.s:d .1.s:d", asIntSet(0, 1));
}
Also used : ConfiguredNode(com.yahoo.vdslib.distribution.ConfiguredNode) Test(org.junit.Test)

Example 10 with ConfiguredNode

use of com.yahoo.vdslib.distribution.ConfiguredNode in project vespa by vespa-engine.

the class RpcServerTest method testGetNodeStateWithConfiguredRetired.

@Test
public void testGetNodeStateWithConfiguredRetired() throws Exception {
    startingTest("RpcServerTest::testGetNodeStateWithConfiguredRetired");
    List<ConfiguredNode> configuredNodes = new ArrayList<>();
    for (int i = 0; i < 9; i++) configuredNodes.add(new ConfiguredNode(i, false));
    // Last node is configured retired
    configuredNodes.add(new ConfiguredNode(9, true));
    FleetControllerOptions options = new FleetControllerOptions("mycluster", configuredNodes);
    options.minRatioOfStorageNodesUp = 0;
    options.maxInitProgressTime = 30000;
    options.stableStateTimePeriod = 60000;
    setUpFleetController(true, options);
    setUpVdsNodes(true, new DummyVdsNodeOptions(), false, configuredNodes);
    waitForState("version:\\d+ distributor:10 storage:10 .9.s:r");
    setWantedNodeState(State.DOWN, NodeType.DISTRIBUTOR, 2);
    setWantedNodeState(State.RETIRED, NodeType.STORAGE, 2);
    setWantedNodeState(State.MAINTENANCE, NodeType.STORAGE, 7);
    waitForCompleteCycle();
    timer.advanceTime(1000000);
    // Make fleet controller notice that time has changed before any disconnects
    waitForCompleteCycle();
    nodes.get(0).disconnect();
    nodes.get(3).disconnect();
    nodes.get(5).disconnect();
    waitForState("version:\\d+ distributor:10 .0.s:d .2.s:d storage:10 .1.s:m .2.s:m .7.s:m .9.s:r");
    timer.advanceTime(1000000);
    waitForState("version:\\d+ distributor:10 .0.s:d .2.s:d storage:10 .1.s:d .2.s:d .7.s:m .9.s:r");
    timer.advanceTime(1000000);
    // Make fleet controller notice that time has changed before any disconnects
    waitForCompleteCycle();
    nodes.get(3).setNodeState(new NodeState(nodes.get(3).getType(), State.INITIALIZING).setInitProgress(0.2));
    nodes.get(3).connect();
    waitForState("version:\\d+ distributor:10 .0.s:d .2.s:d storage:10 .1.s:i .1.i:0.2 .2.s:d .7.s:m .9.s:r");
}
Also used : NodeState(com.yahoo.vdslib.state.NodeState) ConfiguredNode(com.yahoo.vdslib.distribution.ConfiguredNode) ArrayList(java.util.ArrayList) Test(org.junit.Test)

Aggregations

ConfiguredNode (com.yahoo.vdslib.distribution.ConfiguredNode)26 Test (org.junit.Test)8 NodeState (com.yahoo.vdslib.state.NodeState)7 Distribution (com.yahoo.vdslib.distribution.Distribution)6 HashSet (java.util.HashSet)5 Node (com.yahoo.vdslib.state.Node)3 ArrayList (java.util.ArrayList)3 Group (com.yahoo.vdslib.distribution.Group)2 ClusterState (com.yahoo.vdslib.state.ClusterState)2 NodeType (com.yahoo.vdslib.state.NodeType)2 StorDistributionConfig (com.yahoo.vespa.config.content.StorDistributionConfig)2 Int32Value (com.yahoo.jrt.Int32Value)1 Request (com.yahoo.jrt.Request)1 Spec (com.yahoo.jrt.Spec)1 StringValue (com.yahoo.jrt.StringValue)1 Supervisor (com.yahoo.jrt.Supervisor)1 Target (com.yahoo.jrt.Target)1 Transport (com.yahoo.jrt.Transport)1 DatabaseHandler (com.yahoo.vespa.clustercontroller.core.database.DatabaseHandler)1 VdsClusterHtmlRendrer (com.yahoo.vespa.clustercontroller.core.status.statuspage.VdsClusterHtmlRendrer)1