diff options
author | HÃ¥kon Hallingstad <hakon.hallingstad@gmail.com> | 2023-11-07 09:40:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-07 09:40:33 +0100 |
commit | 2fc631ac7e05e728b0bca098a4bbc2cec78c2522 (patch) | |
tree | d66c251711f2a4d278dae07df67a2ade158fdd81 /node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java | |
parent | 5cfeb0a3820e168e906e41769899db4cc6faebab (diff) | |
parent | 300fc3045f97eb9287160d0b7d973d38ccb8df0b (diff) |
Merge pull request #29260 from vespa-engine/revert-29228-hakonhall/evaluate-flags-referenced-multiple-times-at-the-start-of-prepare
Revert "Evaluate flags referenced multiple times at the start of prepare" MERGEOK
Diffstat (limited to 'node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java')
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java index 76c8445eb8c..8c29b40bc26 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/provisioning/NodeCandidate.java @@ -594,8 +594,9 @@ public abstract class NodeCandidate implements Nodelike, Comparable<NodeCandidat PARENT_HOST_NOT_EXCLUSIVE } - public ExclusivityViolation violatesExclusivity(AllocationParams params, NodeList allNodes) { - boolean hostSharing = params.nodeRepository().zone().getCloud().allowHostSharing(); + public ExclusivityViolation violatesExclusivity(ClusterSpec cluster, ApplicationId application, + boolean exclusiveClusterType, boolean exclusiveAllocation, boolean exclusiveProvisioning, + boolean hostSharing, NodeList allNodes, boolean makeExclusive) { if (parentHostname().isEmpty()) return ExclusivityViolation.NONE; if (type() != NodeType.tenant) return ExclusivityViolation.NONE; @@ -604,34 +605,34 @@ public abstract class NodeCandidate implements Nodelike, Comparable<NodeCandidat // then all the nodes on the host must have the same owner. for (Node nodeOnHost : allNodes.childrenOf(parentHostname().get())) { if (nodeOnHost.allocation().isEmpty()) continue; - if (params.exclusiveAllocation() || nodeOnHost.allocation().get().membership().cluster().isExclusive()) { - if ( ! nodeOnHost.allocation().get().owner().equals(params.application())) return ExclusivityViolation.YES; + if (exclusiveAllocation || nodeOnHost.allocation().get().membership().cluster().isExclusive()) { + if ( ! nodeOnHost.allocation().get().owner().equals(application)) return ExclusivityViolation.YES; } } } else { // the parent is exclusive to another cluster type - if ( ! emptyOrEqual(parent.flatMap(Node::exclusiveToClusterType), params.cluster().type())) + if ( ! emptyOrEqual(parent.flatMap(Node::exclusiveToClusterType), cluster.type())) return ExclusivityViolation.YES; // this cluster requires a parent that was provisioned exclusively for this cluster type - if (params.exclusiveClusterType() && parent.flatMap(Node::exclusiveToClusterType).isEmpty() && params.makeExclusive()) + if (exclusiveClusterType && parent.flatMap(Node::exclusiveToClusterType).isEmpty() && makeExclusive) return ExclusivityViolation.YES; // the parent is provisioned for another application - if ( ! emptyOrEqual(parent.flatMap(Node::provisionedForApplicationId), params.application())) + if ( ! emptyOrEqual(parent.flatMap(Node::provisionedForApplicationId), application)) return ExclusivityViolation.YES; // this cluster requires a parent that was provisioned for this application - if (params.exclusiveProvisioning() && parent.flatMap(Node::provisionedForApplicationId).isEmpty()) + if (exclusiveProvisioning && parent.flatMap(Node::provisionedForApplicationId).isEmpty()) return ExclusivityViolation.YES; // the parent is exclusive to another application - if ( ! emptyOrEqual(parent.flatMap(Node::exclusiveToApplicationId), params.application())) + if ( ! emptyOrEqual(parent.flatMap(Node::exclusiveToApplicationId), application)) return ExclusivityViolation.YES; // this cluster requires exclusivity, but the parent is not exclusive - if (params.exclusiveAllocation() && parent.flatMap(Node::exclusiveToApplicationId).isEmpty()) - return canMakeHostExclusive(params.makeExclusive(), type(), hostSharing) ? + if (exclusiveAllocation && parent.flatMap(Node::exclusiveToApplicationId).isEmpty()) + return canMakeHostExclusive(makeExclusive, type(), hostSharing) ? ExclusivityViolation.PARENT_HOST_NOT_EXCLUSIVE : ExclusivityViolation.YES; } |