summaryrefslogtreecommitdiffstats
path: root/clustercontroller-core
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2023-07-18 11:04:19 +0200
committerHarald Musum <musum@yahooinc.com>2023-07-18 11:04:19 +0200
commitf6d3a295bbacae1b81f85439d0c5ffc4628c5273 (patch)
treeb4f1f45318a4e33fa025d76e8f1ea2ad66c2f818 /clustercontroller-core
parent715a4b3e10738eec80446dd06cb8c8e9911cec50 (diff)
Use cluster state to check if disttributors are UP
Diffstat (limited to 'clustercontroller-core')
-rw-r--r--clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeStateChangeChecker.java9
1 files changed, 4 insertions, 5 deletions
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<Result> checkRedundancy(Set<Integer> retiredAndNotUpGroups) {
+ private Optional<Result> checkRedundancy(Set<Integer> retiredAndNotUpGroups, ClusterState clusterState) {
Set<Integer> 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())