diff options
-rw-r--r-- | clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeStateChangeChecker.java | 16 |
1 files changed, 7 insertions, 9 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 31bd9c59992..c81f01bd9aa 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 @@ -422,15 +422,7 @@ public class NodeStateChangeChecker { private Result checkRedundancy(DistributorNodeInfo distributorNodeInfo, Node node) { Integer minReplication = minReplication(distributorNodeInfo).get(node.getIndex()); - // Why test on != null? Missing min-replication is OK (indicate empty/few buckets on system). - if (minReplication != null && minReplication < requiredRedundancy) { - return disallow("Distributor " + distributorNodeInfo.getNodeIndex() - + " says storage node " + node.getIndex() - + " has buckets with redundancy as low as " - + minReplication + ", but we require at least " + requiredRedundancy); - } - - return allow(); + return verifyRedundancy(distributorNodeInfo, minReplication, node.getIndex()); } private Result checkRedundancySeenFromDistributor(DistributorNodeInfo distributorNodeInfo, Set<Integer> indexesToCheck) { @@ -444,11 +436,17 @@ public class NodeStateChangeChecker { if ( ! indexesToCheck.contains(nodeIndex)) continue; if (minReplication == null || (value != null && value < minReplication)) { minReplication = value; + if (minReplication == null) continue; + minReplicationIndex = nodeIndex; if (minReplication < requiredRedundancy) break; } } + return verifyRedundancy(distributorNodeInfo, minReplication, minReplicationIndex); + } + + private Result verifyRedundancy(DistributorNodeInfo distributorNodeInfo, Integer minReplication, Integer minReplicationIndex) { // Why test on != null? Missing min-replication is OK (indicate empty/few buckets on system). if (minReplication != null && minReplication < requiredRedundancy) { return disallow("Distributor " + distributorNodeInfo.getNodeIndex() |