diff options
author | Martin Polden <mpolden@mpolden.no> | 2020-01-14 11:03:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-14 11:03:30 +0100 |
commit | 5a9dcffe32618e0b704996c5ddb33230cca6cbae (patch) | |
tree | ad4fcd35ca18d693b9348e53181218f73bd66274 | |
parent | 29d57953ea867faa7233e9110630ba614ea23b39 (diff) | |
parent | 341885f6cc907cfce915d1322f17316a778ecd42 (diff) |
Merge pull request #11774 from vespa-engine/bratseth/combined-also-with-jdisk-tag
Bratseth/combined also with jdisc tag MERGEOK
4 files changed, 4 insertions, 35 deletions
diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java index e72e05a6ebc..797341afefa 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/NodesSpecification.java @@ -292,7 +292,7 @@ public class NodesSpecification { var contentClusterId = content.get().getAttribute("id"); if (contentClusterId.isEmpty()) return false; for (var rootChild : XML.getChildren(services.get())) { - if (!"container".equals(rootChild.getTagName())) continue; // Only container can reference content + if ( ! "container".equals(rootChild.getTagName()) && ! "jdisc".equals(rootChild.getTagName())) continue; // Only container can reference content var nodes = XML.getChild(rootChild, "nodes"); if (nodes == null) continue; if (!contentClusterId.equals(nodes.getAttribute("of"))) continue; diff --git a/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java b/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java index f1a8b579866..16369d82f9f 100644 --- a/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java +++ b/config-provisioning/src/main/java/com/yahoo/config/provision/ClusterSpec.java @@ -90,10 +90,8 @@ public final class ClusterSpec { * are ignored. */ public boolean satisfies(ClusterSpec other) { - if ( ! other.id.equals(this.id)) return false; // ID mismatch - // TODO(mpolden): Remove this after January 2019, once all nodes in combined clusters have type combined. - if (other.type.isContent() || this.type.isContent()) return other.type.isContent() == this.type.isContent(); - return other.type.equals(this.type); + return other.id.equals(this.id) && + other.type.equals(this.type); } /** A cluster type */ diff --git a/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java b/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java index db90b0ebff9..dc198e5bb0d 100644 --- a/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java +++ b/config-provisioning/src/test/java/com/yahoo/config/provision/ClusterSpecTest.java @@ -40,7 +40,7 @@ public class ClusterSpecTest { List.of(spec(ClusterSpec.Type.admin, "id1"), spec(ClusterSpec.Type.container, "id1")), false, List.of(spec(ClusterSpec.Type.admin, "id1"), spec(ClusterSpec.Type.content, "id1")), false, List.of(spec(ClusterSpec.Type.combined, "id1"), spec(ClusterSpec.Type.container, "id1")), false, - List.of(spec(ClusterSpec.Type.combined, "id1"), spec(ClusterSpec.Type.content, "id1")), true, + List.of(spec(ClusterSpec.Type.combined, "id1"), spec(ClusterSpec.Type.content, "id1")), false, List.of(spec(ClusterSpec.Type.content, "id1"), spec(ClusterSpec.Type.content, "id1")), true ); tests.forEach((specs, satisfies) -> { diff --git a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java index b4e8b2266fb..a54afd1c229 100644 --- a/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java +++ b/node-repository/src/test/java/com/yahoo/vespa/hosted/provision/provisioning/ProvisioningTest.java @@ -625,35 +625,6 @@ public class ProvisioningTest { tester.activate(application, state.allHosts); } - @Test - public void change_to_combined_cluster_does_not_change_node_allocation() { - var tester = new ProvisioningTester.Builder().zone(new Zone(Environment.prod, RegionName.from("us-east"))).build(); - var application = tester.makeApplicationId(); - - tester.makeReadyNodes(4, defaultResources); - - // Application allocates two content nodes initially. This is the old behaviour where combined clusters has type - // content - ClusterSpec cluster = ClusterSpec.request(ClusterSpec.Type.content, - ClusterSpec.Id.from("combined"), - Version.fromString("1.2.3"), - false); - var initialNodes = tester.activate(application, tester.prepare(application, cluster, - Capacity.fromCount(2, defaultResources, false, false), - 1)); - - // Application is redeployed with cluster type combined - cluster = ClusterSpec.request(ClusterSpec.Type.combined, - ClusterSpec.Id.from("combined"), - Version.fromString("1.2.3"), - false); - var newNodes = tester.activate(application, tester.prepare(application, cluster, - Capacity.fromCount(2, defaultResources, false, false), - 1)); - - assertEquals("Node allocation remains the same", initialNodes, newNodes); - } - private SystemState prepare(ApplicationId application, int container0Size, int container1Size, int content0Size, int content1Size, NodeResources flavor, ProvisioningTester tester) { return prepare(application, container0Size, container1Size, content0Size, content1Size, flavor, |