diff options
author | HÃ¥kon Hallingstad <hakon.hallingstad@gmail.com> | 2021-05-14 16:05:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-14 16:05:57 +0200 |
commit | 4112077800f995b0b2776a1f8ef856a63320876d (patch) | |
tree | 362e721a753abc681aed55102a3af8d7ea3d573a /orchestrator/src/main | |
parent | 39ba7e3031e541ad81df88aaaa9c0a942f51f23b (diff) |
Revert "Send setNodeState to CC even if storage node is down"
Diffstat (limited to 'orchestrator/src/main')
3 files changed, 10 insertions, 8 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApi.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApi.java index a8734dd67e5..a6353e39610 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApi.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApi.java @@ -36,6 +36,6 @@ public interface ApplicationApi { } List<StorageNode> getStorageNodesInGroupInClusterOrder(); - List<StorageNode> getNoRemarksStorageNodesInGroupInClusterOrder(); + List<StorageNode> getUpStorageNodesInGroupInClusterOrder(); List<StorageNode> getSuspendedStorageNodesInGroupInReverseClusterOrder(); } diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java index efbf9ff7981..29307b36f4b 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/model/ApplicationApiImpl.java @@ -10,11 +10,12 @@ import com.yahoo.vespa.orchestrator.OrchestratorContext; import com.yahoo.vespa.orchestrator.OrchestratorUtil; import com.yahoo.vespa.orchestrator.controller.ClusterControllerClientFactory; import com.yahoo.vespa.orchestrator.status.ApplicationInstanceStatus; -import com.yahoo.vespa.orchestrator.status.ApplicationLock; import com.yahoo.vespa.orchestrator.status.HostInfos; import com.yahoo.vespa.orchestrator.status.HostStatus; +import com.yahoo.vespa.orchestrator.status.ApplicationLock; import java.time.Clock; +import java.util.Collection; import java.util.Comparator; import java.util.HashSet; import java.util.List; @@ -23,6 +24,8 @@ import java.util.Set; import java.util.function.Predicate; import java.util.stream.Collectors; +import static com.yahoo.vespa.orchestrator.OrchestratorUtil.getHostsUsedByApplicationInstance; + /** * @author hakonhall */ @@ -84,12 +87,11 @@ public class ApplicationApiImpl implements ApplicationApi { } @Override - public List<StorageNode> getNoRemarksStorageNodesInGroupInClusterOrder() { + public List<StorageNode> getUpStorageNodesInGroupInClusterOrder() { return clusterInOrder.stream() - .map(ClusterApi::storageNodeInGroup) + .map(ClusterApi::upStorageNodeInGroup) .filter(Optional::isPresent) .map(Optional::get) - .filter(x -> hostInfos.getOrNoRemarks(x.hostName()).status() == HostStatus.NO_REMARKS) .collect(Collectors.toList()); } diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaPolicy.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaPolicy.java index d9fc2a989de..8090a4e95c4 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaPolicy.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/policy/HostedVespaPolicy.java @@ -48,9 +48,9 @@ public class HostedVespaPolicy implements Policy { suspensionReasons.mergeWith(clusterPolicy.verifyGroupGoingDownIsFine(cluster)); } - // Ask Cluster Controller to set storage nodes in maintenance, unless the node is already allowed - // to be down (or permanently down) in case they are guaranteed to be in maintenance already. - for (StorageNode storageNode : application.getNoRemarksStorageNodesInGroupInClusterOrder()) { + // Ask Cluster Controller to set UP storage nodes in maintenance. + // These storage nodes are guaranteed to be NO_REMARKS + for (StorageNode storageNode : application.getUpStorageNodesInGroupInClusterOrder()) { storageNode.setNodeState(context, ClusterControllerNodeState.MAINTENANCE); } |