From c74979642e45ad49cf59ea611fc562fc96f89df2 Mon Sep 17 00:00:00 2001 From: Martin Polden Date: Thu, 2 Jul 2020 10:22:54 +0200 Subject: Fix routing control for weighted records When the weight sum for a record group in a region is 0, we have to remove the record itself to disable routing to that region. --- .../vespa/hosted/controller/api/integration/dns/WeightedAliasTarget.java | 1 + 1 file changed, 1 insertion(+) (limited to 'controller-api/src') diff --git a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/WeightedAliasTarget.java b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/WeightedAliasTarget.java index 8f81c94257e..d3d60ecd64d 100644 --- a/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/WeightedAliasTarget.java +++ b/controller-api/src/main/java/com/yahoo/vespa/hosted/controller/api/integration/dns/WeightedAliasTarget.java @@ -21,6 +21,7 @@ public class WeightedAliasTarget extends AliasTarget { public WeightedAliasTarget(HostName name, String dnsZone, ZoneId zone, long weight) { super(name, dnsZone, zone.value()); this.weight = weight; + if (weight < 0) throw new IllegalArgumentException("Weight cannot be negative"); } /** The weight of this target */ -- cgit v1.2.3