diff options
author | HÃ¥kon Hallingstad <hakon@oath.com> | 2018-10-30 09:18:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-30 09:18:24 +0100 |
commit | edee5b90c4a0b0bba89a801952ab4c883aa39b4b (patch) | |
tree | 193da8781cffcfa821a9f43ea5531f36f3eb0476 /clustercontroller-core/src/main/java/com/yahoo | |
parent | 522ecd04d8a655ad99f4b915ea37e7c5c3cbb39b (diff) | |
parent | b83edd843e9eddd36d57f07f919bcf6475196363 (diff) |
Merge pull request #7490 from vespa-engine/revert-7472-revert-7470-revert-7424-hakonhall/enforce-cc-timeouts-in-orchestrator-2
Revert "Revert "Revert "Enforce CC timeouts in Orchestrator 2"""
Diffstat (limited to 'clustercontroller-core/src/main/java/com/yahoo')
3 files changed, 11 insertions, 24 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/SetNodeStateRequest.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/SetNodeStateRequest.java index eecdcc75228..4d6738940a8 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/SetNodeStateRequest.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/SetNodeStateRequest.java @@ -37,7 +37,6 @@ public class SetNodeStateRequest extends Request<SetResponse> { private final SetUnitStateRequest.ResponseWait responseWait; private final WantedStateSetter wantedState; private final TimeBudget timeBudget; - private final boolean probe; public SetNodeStateRequest(Id.Node id, SetUnitStateRequest setUnitStateRequest) { this(id, setUnitStateRequest, SetNodeStateRequest::setWantedState); @@ -52,7 +51,6 @@ public class SetNodeStateRequest extends Request<SetResponse> { this.responseWait = setUnitStateRequest.getResponseWait(); this.wantedState = wantedState; this.timeBudget = setUnitStateRequest.timeBudget(); - this.probe = setUnitStateRequest.isProbe(); } @Override @@ -63,8 +61,7 @@ public class SetNodeStateRequest extends Request<SetResponse> { newStates, id.getNode(), context.nodeStateOrHostInfoChangeHandler, - context.currentConsolidatedState, - probe); + context.currentConsolidatedState); } static NodeState getRequestedNodeState(Map<String, UnitState> newStates, Node n) throws StateRestApiException { @@ -103,8 +100,7 @@ public class SetNodeStateRequest extends Request<SetResponse> { Map<String, UnitState> newStates, Node node, NodeStateOrHostInfoChangeHandler stateListener, - ClusterState currentClusterState, - boolean probe) throws StateRestApiException { + ClusterState currentClusterState) throws StateRestApiException { if ( ! cluster.hasConfiguredNode(node.getIndex())) { throw new MissingIdException(cluster.getName(), node); } @@ -130,8 +126,7 @@ public class SetNodeStateRequest extends Request<SetResponse> { condition, nodeInfo, cluster, - stateListener, - probe); + stateListener); // If the state was successfully set, just return an "ok" message back. String reason = success ? "ok" : result.getReason(); @@ -148,10 +143,9 @@ public class SetNodeStateRequest extends Request<SetResponse> { SetUnitStateRequest.Condition condition, NodeInfo nodeInfo, ContentCluster cluster, - NodeStateOrHostInfoChangeHandler stateListener, - boolean probe) { + NodeStateOrHostInfoChangeHandler stateListener) { if (result.settingWantedStateIsAllowed()) { - setNewWantedState(nodeInfo, newWantedState, stateListener, probe); + setNewWantedState(nodeInfo, newWantedState, stateListener); } // True if the wanted state was or has just been set to newWantedState @@ -162,7 +156,7 @@ public class SetNodeStateRequest extends Request<SetResponse> { // of the distributor. E.g. setting the storage node to maintenance may cause // feeding issues unless distributor is also set down. - setDistributorWantedState(cluster, nodeInfo.getNodeIndex(), newWantedState, stateListener, probe); + setDistributorWantedState(cluster, nodeInfo.getNodeIndex(), newWantedState, stateListener); } return success; @@ -175,8 +169,7 @@ public class SetNodeStateRequest extends Request<SetResponse> { private static void setDistributorWantedState(ContentCluster cluster, int index, NodeState newStorageWantedState, - NodeStateOrHostInfoChangeHandler stateListener, - boolean probe) { + NodeStateOrHostInfoChangeHandler stateListener) { Node distributorNode = new Node(NodeType.DISTRIBUTOR, index); NodeInfo nodeInfo = cluster.getNodeInfo(distributorNode); if (nodeInfo == null) { @@ -207,15 +200,13 @@ public class SetNodeStateRequest extends Request<SetResponse> { if (newWantedState.getState() != currentWantedState.getState() || !Objects.equals(newWantedState.getDescription(), currentWantedState.getDescription())) { - setNewWantedState(nodeInfo, newWantedState, stateListener, probe); + setNewWantedState(nodeInfo, newWantedState, stateListener); } } private static void setNewWantedState(NodeInfo nodeInfo, NodeState newWantedState, - NodeStateOrHostInfoChangeHandler stateListener, - boolean probe) { - if (probe) return; + NodeStateOrHostInfoChangeHandler stateListener) { nodeInfo.setWantedState(newWantedState); stateListener.handleNewWantedNodeState(nodeInfo, newWantedState); } diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/SetNodeStatesForClusterRequest.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/SetNodeStatesForClusterRequest.java index d7820722887..b4d189bcd55 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/SetNodeStatesForClusterRequest.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/SetNodeStatesForClusterRequest.java @@ -27,7 +27,6 @@ public class SetNodeStatesForClusterRequest extends Request<SetResponse> { private final Map<String, UnitState> newStates; private final SetUnitStateRequest.Condition condition; private final TimeBudget timeBudget; - private final boolean probe; public SetNodeStatesForClusterRequest(Id.Cluster cluster, SetUnitStateRequest request) { @@ -36,7 +35,6 @@ public class SetNodeStatesForClusterRequest extends Request<SetResponse> { this.newStates = request.getNewState(); this.condition = request.getCondition(); this.timeBudget = request.timeBudget(); - this.probe = request.isProbe(); } @Override @@ -71,8 +69,7 @@ public class SetNodeStatesForClusterRequest extends Request<SetResponse> { newStates, node, context.nodeStateOrHostInfoChangeHandler, - context.currentConsolidatedState, - probe); + context.currentConsolidatedState); if (!setResponse.getWasModified()) { throw new InternalFailure("We have not yet implemented the meaning of " + diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/WantedStateSetter.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/WantedStateSetter.java index c3090a5e832..6fa7d536c67 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/WantedStateSetter.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/restapiv2/requests/WantedStateSetter.java @@ -22,6 +22,5 @@ public interface WantedStateSetter { Map<String, UnitState> newStates, Node node, NodeStateOrHostInfoChangeHandler stateListener, - ClusterState currentClusterState, - boolean probe) throws StateRestApiException; + ClusterState currentClusterState) throws StateRestApiException; } |