From 0907a02b8a603fd5a3ee1d3c06517eb5332381dd Mon Sep 17 00:00:00 2001 From: HÃ¥kon Hallingstad Date: Thu, 14 Jun 2018 13:50:17 +0200 Subject: 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. --- .../controller/RetryingClusterControllerClientFactory.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'orchestrator') 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 clusterControllerSet = clusterControllers.stream().collect(Collectors.toSet()); JaxRsStrategy 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); } -- cgit v1.2.3