summaryrefslogtreecommitdiffstats
path: root/node-admin/src
diff options
context:
space:
mode:
authorValerij Fredriksen <freva@users.noreply.github.com>2018-11-12 16:00:55 +0100
committerGitHub <noreply@github.com>2018-11-12 16:00:55 +0100
commit4b2f8624a8faba4117ef17fa4e87f033e3ab7a85 (patch)
treed87df53630c6fadcabcc5a6087e6aa983169fcc6 /node-admin/src
parentd256bfe465d706349af3e3c12876f76d3ef09981 (diff)
parent6545a72bfacce15e84dd4535f95bcff7616ddc1c (diff)
Merge pull request #7634 from vespa-engine/freva/node-restart-gen-fix
Fix restart generation bug
Diffstat (limited to 'node-admin/src')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java9
1 files changed, 7 insertions, 2 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java
index 82802a4c6af..6b9a7d4021a 100644
--- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java
+++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java
@@ -470,10 +470,15 @@ public class NodeAgentImpl implements NodeAgent {
if (!node.equals(lastNode)) {
logChangesToNodeSpec(lastNode, node);
- if (lastNode == null) {
+ // Current reboot generation uninitialized or incremented from outside to cancel reboot
+ if (currentRebootGeneration < node.getCurrentRebootGeneration())
currentRebootGeneration = node.getCurrentRebootGeneration();
+
+ // Either we have changed allocation status (restart gen. only available to allocated nodes), or
+ // restart generation has been incremented from outside to cancel restart
+ if (currentRestartGeneration.isPresent() != node.getCurrentRestartGeneration().isPresent() ||
+ currentRestartGeneration.map(current -> current < node.getCurrentRestartGeneration().get()).orElse(false))
currentRestartGeneration = node.getCurrentRestartGeneration();
- }
// Every time the node spec changes, we should clear the metrics for this container as the dimensions
// will change and we will be reporting duplicate metrics.