diff options
author | Håkon Hallingstad <hakon@oath.com> | 2018-06-14 13:50:17 +0200 |
---|---|---|
committer | Håkon Hallingstad <hakon@oath.com> | 2018-06-14 13:50:17 +0200 |
commit | 0907a02b8a603fd5a3ee1d3c06517eb5332381dd (patch) | |
tree | 0b9cc0666e796e931a608d5ad1cdcc7ff4dd56bc /orchestrator | |
parent | 23ccc915f80a2612f4c6d04de2647b1a9e62a42e (diff) |
Avoid set-node-state retry
Today, the Orchestrator will call each cluster controller twice, e.g. indices
1, 2, 0, 1, 2, 0, if each time out.
This is unnecessary. The minimum number of calls is 2:
- Either the first CC is up and will redirect to master if necessary, or
- the second is up and will redirect to master if necessary, or
- the third won't have quorum.
This PR changes the current strategy to call all CCs once, e.g. indices 1, 2,
and 0.
Diffstat (limited to 'orchestrator')
-rw-r--r-- | orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/RetryingClusterControllerClientFactory.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/RetryingClusterControllerClientFactory.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/RetryingClusterControllerClientFactory.java index c7aae6ea93d..5571eedeec6 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/RetryingClusterControllerClientFactory.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/RetryingClusterControllerClientFactory.java @@ -41,7 +41,13 @@ public class RetryingClusterControllerClientFactory implements ClusterController Set<HostName> clusterControllerSet = clusterControllers.stream().collect(Collectors.toSet()); JaxRsStrategy<ClusterControllerJaxRsApi> jaxRsApi = new JaxRsStrategyFactory(clusterControllerSet, HARDCODED_CLUSTERCONTROLLER_PORT, jaxRsClientFactory, CLUSTERCONTROLLER_SCHEME) - .apiWithRetries(ClusterControllerJaxRsApi.class, CLUSTERCONTROLLER_API_PATH); + .apiWithRetries(ClusterControllerJaxRsApi.class, CLUSTERCONTROLLER_API_PATH) + // Use max iteration 1. The JaxRsStrategyFactory will try host 1, 2, then 3: + // - If host 1 responds, it will redirect to master if necessary. Otherwise + // - If host 2 responds, it will redirect to master if necessary. Otherwise + // - If host 3 responds, it may redirect to master if necessary (if they're up + // after all), but more likely there's no quorum and this will fail too. + .setMaxIterations(1); return new ClusterControllerClientImpl(jaxRsApi, clusterName); } |