aboutsummaryrefslogtreecommitdiffstats
path: root/config-model
diff options
context:
space:
mode:
authorJon Bratseth <bratseth@oath.com>2021-05-25 17:02:08 +0200
committerGitHub <noreply@github.com>2021-05-25 17:02:08 +0200
commit8e3d515ff5c5c58ce6e7ae16ac386f9e4655494c (patch)
tree380ccb519edbfd2db58a9ef6ca75c51179003bf5 /config-model
parent69cf843602f1e62582d365acca812357b712e883 (diff)
parent64d4f671944b75d26422ecff4f686179f5615882 (diff)
Merge pull request #17708 from vespa-engine/bratseth/stable-slobrok-pick
Pick the same slobroks each time
Diffstat (limited to 'config-model')
-rw-r--r--config-model/src/main/java/com/yahoo/vespa/model/builder/xml/dom/DomAdminV4Builder.java5
1 files changed, 3 insertions, 2 deletions
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 e27faa13000..bbec64d45fb 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<HostResource> 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<HostResource> 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()));
}