aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Musum <musum@yahooinc.com>2023-06-22 17:22:02 +0200
committerHarald Musum <musum@yahooinc.com>2023-06-22 17:22:02 +0200
commitfb3c8fb255f1caf4f9fb05dc65a54536a77b9c74 (patch)
tree1647df4147864973ebcfba020fc19b37d5aa9698
parentaa14dec6cb31fdebe138ebe99f2b4881507cebba (diff)
Revert back to previous way of doing this
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/HostCapacityMaintainer.java7
1 files changed, 2 insertions, 5 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/HostCapacityMaintainer.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/HostCapacityMaintainer.java
index ac3e5267208..e8ba75113c6 100644
--- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/HostCapacityMaintainer.java
+++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/HostCapacityMaintainer.java
@@ -106,7 +106,8 @@ public class HostCapacityMaintainer extends NodeRepositoryMaintainer {
attempts++;
// Any hosts that are no longer empty should be marked as such, and excluded from removal.
- if (someChildrenCannotBeDeprovisioned(currentNodesByParent, host) && host.hostEmptyAt().isPresent()) {
+ if (currentNodesByParent.getOrDefault(Optional.of(host.hostname()), List.of()).stream().anyMatch(n -> ! canDeprovision(n))
+ && host.hostEmptyAt().isPresent()) {
nodeRepository().nodes().write(host.withHostEmptyAt(null), lock);
}
// If the host is still empty, we can mark it as empty now, or mark it for removal if it has already expired.
@@ -304,8 +305,4 @@ public class HostCapacityMaintainer extends NodeRepositoryMaintainer {
return getChildren(nodesByParent, host).stream().allMatch(HostCapacityMaintainer::canDeprovision);
}
- private static boolean someChildrenCannotBeDeprovisioned(Map<Optional<String>, List<Node>> nodesByParent, Node host) {
- return ! allChildrenCanBeDeprovisioned(nodesByParent, host);
- }
-
}