summaryrefslogtreecommitdiffstats
path: root/node-admin
diff options
context:
space:
mode:
authorValerij Fredriksen <valerijf@oath.com>2018-11-12 15:24:54 +0100
committerValerij Fredriksen <valerijf@oath.com>2018-11-12 15:35:37 +0100
commit6545a72bfacce15e84dd4535f95bcff7616ddc1c (patch)
treef4af2bd8d500dcc9c54cf3fe542b504bbb79d6f4 /node-admin
parent0f9ebd65290f4ae593090001993ba5230c56e533 (diff)
Fix restart generation bug
Diffstat (limited to 'node-admin')
-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.