summaryrefslogtreecommitdiffstats
path: root/node-admin/src
diff options
context:
space:
mode:
authorValerij Fredriksen <valerijf@oath.com>2018-11-07 17:13:27 +0100
committerValerij Fredriksen <valerijf@oath.com>2018-11-07 17:13:27 +0100
commitf3aeb2d737af2058d39581c6a375e8efe61a77a7 (patch)
treedc9464d016b06a208699350c5f2e4e553bc559e5 /node-admin/src
parentcb3ac3a970d519fcb6d53b4ec9eca99c5043925b (diff)
Simplify
Diffstat (limited to 'node-admin/src')
-rw-r--r--node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/nodeagent/NodeAgentImpl.java8
1 files changed, 4 insertions, 4 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 da6656ac830..82802a4c6af 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
@@ -227,7 +227,8 @@ public class NodeAgentImpl implements NodeAgent {
final NodeAttributes currentNodeAttributes = new NodeAttributes();
final NodeAttributes newNodeAttributes = new NodeAttributes();
- if (!Objects.equals(node.getCurrentRestartGeneration(), currentRestartGeneration)) {
+ if (node.getWantedRestartGeneration().isPresent() &&
+ !Objects.equals(node.getCurrentRestartGeneration(), currentRestartGeneration)) {
currentNodeAttributes.withRestartGeneration(node.getCurrentRestartGeneration());
newNodeAttributes.withRestartGeneration(currentRestartGeneration);
}
@@ -469,11 +470,10 @@ public class NodeAgentImpl implements NodeAgent {
if (!node.equals(lastNode)) {
logChangesToNodeSpec(lastNode, node);
- if (currentRebootGeneration < node.getCurrentRebootGeneration())
+ if (lastNode == null) {
currentRebootGeneration = node.getCurrentRebootGeneration();
-
- if (currentRestartGeneration.isPresent() != node.getCurrentRestartGeneration().isPresent())
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.