diff options
author | Andreas Eriksen <andreer@yahooinc.com> | 2022-10-18 15:09:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-18 15:09:55 +0200 |
commit | 7a8571355a737aab02934ad5cf9fc8521c429b54 (patch) | |
tree | 98d12f209b005c8c792110264131b1fbd324fb2b /node-repository/src/main/java/com | |
parent | 132b1cf81cd016a8b4bff2e74c6cb1b9fba1b226 (diff) |
Revert "Do not update history if reboot generation is unchanged" (#24494)v8.70.31
Co-authored-by: Martin Polden <mpolden@mpolden.no>
Diffstat (limited to 'node-repository/src/main/java/com')
-rw-r--r-- | node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java index d9e0e4292e8..9cba823500b 100644 --- a/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java +++ b/node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java @@ -468,13 +468,10 @@ public final class Node implements Nodelike { /** Returns a copy of this node with the current reboot generation set to the given number at the given instant */ public Node withCurrentRebootGeneration(long generation, Instant instant) { - if (generation == status.reboot().current()) { - return this; // No change - } - if (generation < status.reboot().current()) { + if (generation < status.reboot().current()) throw new IllegalArgumentException("Cannot set reboot generation to " + generation + - ": lower than current generation: " + status.reboot().current()); - } + ": lower than current generation: " + status.reboot().current()); + Status newStatus = status().withReboot(status().reboot().withCurrent(generation)); History newHistory = history.with(new History.Event(History.Event.Type.rebooted, Agent.system, instant)); return this.with(newStatus).with(newHistory); |