From f6d3a295bbacae1b81f85439d0c5ffc4628c5273 Mon Sep 17 00:00:00 2001 From: Harald Musum Date: Tue, 18 Jul 2023 11:04:19 +0200 Subject: Use cluster state to check if disttributors are UP --- .../vespa/clustercontroller/core/NodeStateChangeChecker.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'clustercontroller-core/src/main/java/com/yahoo') diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeStateChangeChecker.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeStateChangeChecker.java index c6fc9c8c184..8453fb3450c 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeStateChangeChecker.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeStateChangeChecker.java @@ -266,7 +266,7 @@ public class NodeStateChangeChecker { numberOfGroupsToConsider = retiredAndNotUpGroups.size() - 1; } - var result = checkRedundancy(retiredAndNotUpGroups); + var result = checkRedundancy(retiredAndNotUpGroups, clusterState); if (result.isPresent() && result.get().notAllowed()) return result; @@ -280,15 +280,14 @@ public class NodeStateChangeChecker { sortSetIntoList(retiredAndNotUpGroups)))); } - // Check redundancy for nodes seen from all distributors that are UP for + // Check redundancy for nodes seen from all distributors that are UP in cluster state for // storage nodes that are in groups that should be UP - private Optional checkRedundancy(Set retiredAndNotUpGroups) { + private Optional checkRedundancy(Set retiredAndNotUpGroups, ClusterState clusterState) { Set indexesToCheck = new HashSet<>(); retiredAndNotUpGroups.forEach(index -> getNodesInGroup(index).forEach(node -> indexesToCheck.add(node.index()))); for (var distributorNodeInfo : clusterInfo.getDistributorNodeInfos()) { - // Skip distributors that are DOWN (otherwise they will be UP and should be checked) - if (distributorNodeInfo.getUserWantedState().getState() != UP) continue; + if (clusterState.getNodeState(distributorNodeInfo.getNode()).getState() != UP) continue; var r = checkRedundancySeenFromDistributor(distributorNodeInfo, indexesToCheck); if (r.notAllowed()) -- cgit v1.2.3