From 64d4f671944b75d26422ecff4f686179f5615882 Mon Sep 17 00:00:00 2001 From: Jon Bratseth Date: Mon, 3 May 2021 10:09:35 +0200 Subject: Pick the same slobroks each time --- .../com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'config-model/src') diff --git a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java index a0673824907..5e6140c83a8 100644 --- a/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java +++ b/config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java @@ -153,8 +153,8 @@ public class DomAdminV4Builder extends DomAdminBuilderBase { List picked = sortedContainerHostsFrom(model, count, !retired); // if we can return multiple hosts, include retired nodes which would have been picked before - // (probably - assuming all previous nodes were retired, which is always true for a single cluster - // at the moment (Sept 2015)) to ensure a smoother transition between the old and new topology + // (probably - assuming all previous nodes were retired, which is always true for a single cluster, + // to ensure a smoother transition between the old and new topology // by including both new and old nodes during the retirement period picked.addAll(sortedContainerHostsFrom(model, count, retired)); @@ -166,6 +166,7 @@ public class DomAdminV4Builder extends DomAdminBuilderBase { List hosts = model.getCluster().getContainers().stream() .filter(container -> retired == container.isRetired()) .map(Container::getHostResource) + .sorted(HostResource::comparePrimarilyByIndexTo) .collect(Collectors.toList()); return hosts.subList(0, Math.min(count, hosts.size())); } -- cgit v1.2.3