aboutsummaryrefslogtreecommitdiffstats
path: root/node-repository
diff options
context:
space:
mode:
authorMartin Polden <mpolden@mpolden.no>2022-10-14 11:28:21 +0200
committerMartin Polden <mpolden@mpolden.no>2022-10-14 11:28:21 +0200
commitfcbac642cb092812ad4abdc6f8c5970dbbd7cfcb (patch)
tree63bcc3194663da72e812efec3bd8507f257f3dc2 /node-repository
parent54e3be422fec0593511dc55b1a11deab65bef9ff (diff)
Do not update history if reboot generation is unchanged
Diffstat (limited to 'node-repository')
-rw-r--r--node-repository/src/main/java/com/yahoo/vespa/hosted/provision/Node.java9
1 files changed, 6 insertions, 3 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 9cba823500b..d9e0e4292e8 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,10 +468,13 @@ 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())
+ if (generation == status.reboot().current()) {
+ return this; // No change
+ }
+ 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);