diff options
author | Martin Polden <mpolden@mpolden.no> | 2019-12-20 13:58:59 +0100 |
---|---|---|
committer | Martin Polden <mpolden@mpolden.no> | 2019-12-20 15:02:11 +0100 |
commit | 203323a52bfbe0d76eff93b59ef5fc28436fbf87 (patch) | |
tree | 1d454394ffda9c45acf6a8d7f16639eb1655301e /controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions | |
parent | d60817bf4723bdf72a5b6e540bf2006f836fa834 (diff) |
Count incomplete upgrades in VersionStatus
Diffstat (limited to 'controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions')
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/VersionStatus.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/VersionStatus.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/VersionStatus.java index ee6cd35b90a..1c4fe391a35 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/VersionStatus.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/VersionStatus.java @@ -14,7 +14,6 @@ import com.yahoo.vespa.hosted.controller.application.Deployment; import com.yahoo.vespa.hosted.controller.application.SystemApplication; import com.yahoo.vespa.hosted.controller.deployment.DeploymentStatus; import com.yahoo.vespa.hosted.controller.deployment.DeploymentStatusList; -import com.yahoo.vespa.hosted.controller.deployment.JobList; import com.yahoo.vespa.hosted.controller.deployment.JobStatus; import com.yahoo.vespa.hosted.controller.deployment.RunStatus; import com.yahoo.vespa.hosted.controller.maintenance.SystemUpgrader; @@ -202,13 +201,19 @@ public class VersionStatus { versionMap.computeIfAbsent(deployment.version(), DeploymentStatistics::empty); status.instanceJobs().forEach((id, jobs) -> { + // Add all unsuccessful runs for failing jobs as any run may have resulted in an incomplete deployment + // where a subset of nodes have upgraded. jobs.failing() .not().failingApplicationChange() .not().withStatus(RunStatus.outOfCapacity) - .lastCompleted().mapToList(run -> run.versions().targetPlatform()) - .forEach(version -> versionMap.put(version, - versionMap.getOrDefault(version, DeploymentStatistics.empty(version)) - .withFailing(id))); + .mapToList(JobStatus::runs) + .forEach(runs -> runs.descendingMap().values().stream() + .dropWhile(run -> !run.hasEnded()) + .takeWhile(run -> run.hasFailed()) + .map(run -> run.versions().targetPlatform()) + .forEach(version -> versionMap.put(version, + versionMap.getOrDefault(version, DeploymentStatistics.empty(version)) + .withFailing(id)))); jobs.production() .lastSuccess().mapToList(run -> run.versions().targetPlatform()) |