diff options
author | Martin Polden <mpolden@mpolden.no> | 2021-01-28 16:05:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-28 16:05:39 +0100 |
commit | 64762584188c55c0a03b52b4baa37486f4810831 (patch) | |
tree | a4017f7798a8c77001658eba87f9cd04a2e4ea96 | |
parent | 26d2a141bd34e8c93bbd23c06e08432b71bc7fb0 (diff) |
Do not expect nodes to downgrade in change duration metric (#16273)
-rw-r--r-- | controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/NodeVersion.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/NodeVersion.java b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/NodeVersion.java index 7aab759f676..15136ed79eb 100644 --- a/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/NodeVersion.java +++ b/controller-server/src/main/java/com/yahoo/vespa/hosted/controller/versions/NodeVersion.java @@ -56,7 +56,7 @@ public class NodeVersion { /** Returns the duration of the change in this, measured relative to instant */ public Duration changeDuration(Instant instant) { - if (!changing()) return Duration.ZERO; + if (!upgrading()) return Duration.ZERO; if (suspendedAt.isEmpty()) return Duration.ZERO; // Node hasn't suspended to apply the change yet return Duration.between(suspendedAt.get(), instant).abs(); } @@ -88,9 +88,9 @@ public class NodeVersion { return Objects.hash(hostname, zone, currentVersion, wantedVersion, suspendedAt); } - /** Returns whether this is changing (upgrading or downgrading) */ - private boolean changing() { - return !currentVersion.equals(wantedVersion); + /** Returns whether this is upgrading */ + private boolean upgrading() { + return currentVersion.isBefore(wantedVersion); } } |