diff options
author | Harald Musum <musum@yahooinc.com> | 2023-06-22 17:22:02 +0200 |
---|---|---|
committer | Harald Musum <musum@yahooinc.com> | 2023-06-22 17:22:02 +0200 |
commit | fb3c8fb255f1caf4f9fb05dc65a54536a77b9c74 (patch) | |
tree | 1647df4147864973ebcfba020fc19b37d5aa9698 /node-repository/src | |
parent | aa14dec6cb31fdebe138ebe99f2b4881507cebba (diff) |
Revert back to previous way of doing this
Diffstat (limited to 'node-repository/src')
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/maintenance/HostCapacityMaintainer.java | 7 |
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); - } - } |