summaryrefslogtreecommitdiffstats
path: root/clustercontroller-core
diff options
context:
space:
mode:
authorTor Brede Vekterli <vekterli@verizonmedia.com>2019-03-19 15:24:55 +0100
committerTor Brede Vekterli <vekterli@verizonmedia.com>2019-03-20 16:56:58 +0100
commit83665fa55dc66388bd134136ac09c30fb93a99eb (patch)
tree8bbea5109c1dc52e96ec6333496a404acb0c73e6 /clustercontroller-core
parent3e72f83f8e36223043279af3f847cd5fc5977309 (diff)
Add activated state version to node status page row
Only displayed if not equal to published state version and if two-phase transitions are enabled.
Diffstat (limited to 'clustercontroller-core')
-rw-r--r--clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java2
-rw-r--r--clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/LegacyIndexPageRequestHandler.java2
-rw-r--r--clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/statuspage/VdsClusterHtmlRendrer.java17
-rw-r--r--clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentClusterHtmlRendrerTest.java7
4 files changed, 18 insertions, 10 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java
index 6ff297b4a31..43412311436 100644
--- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java
+++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ContentCluster.java
@@ -45,7 +45,7 @@ public class ContentCluster {
final VdsClusterHtmlRendrer vdsClusterHtmlRendrer,
final StringBuilder sb,
final Timer timer,
- final ClusterState state,
+ final ClusterStateBundle state,
final ClusterStatsAggregator statsAggregator,
final Distribution distribution,
final FleetControllerOptions options,
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/LegacyIndexPageRequestHandler.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/LegacyIndexPageRequestHandler.java
index 07195d05aa8..6d11c4f1239 100644
--- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/LegacyIndexPageRequestHandler.java
+++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/LegacyIndexPageRequestHandler.java
@@ -65,7 +65,7 @@ public class LegacyIndexPageRequestHandler implements StatusPageServer.RequestHa
new VdsClusterHtmlRendrer(),
content,
timer,
- stateVersionTracker.getVersionedClusterState(),
+ stateVersionTracker.getVersionedClusterStateBundle(),
stateVersionTracker.getAggregatedClusterStats(),
data.getOptions().storageDistribution,
data.getOptions(),
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/statuspage/VdsClusterHtmlRendrer.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/statuspage/VdsClusterHtmlRendrer.java
index f18687e6bb6..0daa9ff7d37 100644
--- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/statuspage/VdsClusterHtmlRendrer.java
+++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/statuspage/VdsClusterHtmlRendrer.java
@@ -64,7 +64,7 @@ public class VdsClusterHtmlRendrer {
final TreeMap<Integer, NodeInfo> storageNodeInfos,
final TreeMap<Integer, NodeInfo> distributorNodeInfos,
final Timer timer,
- final ClusterState state,
+ final ClusterStateBundle state,
final ClusterStatsAggregator statsAggregator,
final double minMergeCompletionRatio,
final int maxPrematureCrashes,
@@ -161,7 +161,7 @@ public class VdsClusterHtmlRendrer {
final TreeMap<Integer, NodeInfo> nodeInfos,
final NodeType nodeType,
final Timer timer,
- final ClusterState state,
+ final ClusterStateBundle stateBundle,
final ClusterStatsAggregator statsAggregator,
final double minMergeCompletionRatio,
final int maxPrematureCrashes,
@@ -169,6 +169,7 @@ public class VdsClusterHtmlRendrer {
final String pathPrefix,
final String dominantVtag,
final String name) {
+ final ClusterState state = stateBundle.getBaselineClusterState();
final long currentTime = timer.getCurrentTimeInMillis();
addTableHeader(name, nodeType);
for (final NodeInfo nodeInfo : nodeInfos.values()) {
@@ -184,7 +185,7 @@ public class VdsClusterHtmlRendrer {
addFailedConnectionAttemptCount(nodeInfo, row, timeSinceContact);
addTimeSinceFirstFailing(nodeInfo, row, timeSinceContact);
addStatePendingTime(currentTime, nodeInfo, row);
- addSystemStateVersion(state, nodeInfo, row);
+ addClusterStateVersion(stateBundle, nodeInfo, row);
addPrematureCrashes(maxPrematureCrashes, nodeInfo, row);
addEventsLastWeek(eventLog, currentTime, nodeInfo, row);
addBucketSpacesStats(nodeType, statsAggregator, minMergeCompletionRatio, nodeInfo, row);
@@ -250,8 +251,12 @@ public class VdsClusterHtmlRendrer {
}
}
- private void addSystemStateVersion(ClusterState state, NodeInfo nodeInfo, HtmlTable.Row row) {
- row.addCell(new HtmlTable.Cell("" + nodeInfo.getClusterStateVersionBundleAcknowledged()));
+ private void addClusterStateVersion(ClusterStateBundle state, NodeInfo nodeInfo, HtmlTable.Row row) {
+ String cellContent = (nodeInfo.getClusterStateVersionActivationAcked() == state.getVersion() || !state.deferredActivation())
+ ? String.format("%d", nodeInfo.getClusterStateVersionBundleAcknowledged())
+ : String.format("%d (%d)", nodeInfo.getClusterStateVersionBundleAcknowledged(),
+ nodeInfo.getClusterStateVersionActivationAcked());
+ row.addCell(new HtmlTable.Cell(cellContent));
if (nodeInfo.getClusterStateVersionBundleAcknowledged() < state.getVersion() - 2) {
row.getLastCell().addProperties(ERROR_PROPERTY);
} else if (nodeInfo.getClusterStateVersionBundleAcknowledged() < state.getVersion()) {
@@ -385,7 +390,7 @@ public class VdsClusterHtmlRendrer {
.append("3) SPT - State pending time - Time the current getNodeState request has been " +
"pending.<br>\n")
.append("4) SSV - System state version - The latest system state version the node has " +
- "acknowledged.<br>\n")
+ "acknowledged (last <em>activated</em> state version in parentheses if this is not equal to SSV).<br>\n")
.append("5) PC - Premature crashes - Number of times node has crashed since last time it had " +
"been stable in up or down state for more than "
+ RealTimer.printDuration(stableStateTimePeriode) + ".<br>\n")
diff --git a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentClusterHtmlRendrerTest.java b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentClusterHtmlRendrerTest.java
index f5adf644c28..9a3edf8e681 100644
--- a/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentClusterHtmlRendrerTest.java
+++ b/clustercontroller-core/src/test/java/com/yahoo/vespa/clustercontroller/core/ContentClusterHtmlRendrerTest.java
@@ -29,7 +29,10 @@ public class ContentClusterHtmlRendrerTest {
@Before
public void before() throws JSONException, ParseException {
- final ClusterState state = new ClusterState("version:34633 bits:24 distributor:211 storage:211");
+ final ClusterStateBundle stateBundle = ClusterStateBundle.ofBaselineOnly(
+ AnnotatedClusterState.withoutAnnotations(
+ ClusterState.stateFromString("version:34633 bits:24 distributor:211 storage:211")));
+ final ClusterState state = stateBundle.getBaselineClusterState();
final EventLog eventLog = new EventLog(new FakeTimer(), null);
final VdsClusterHtmlRendrer.Table table = rendrer.createNewClusterHtmlTable(clusterName, slobrokGeneration);
@@ -55,7 +58,7 @@ public class ContentClusterHtmlRendrerTest {
storageNodeInfoByIndex,
distributorNodeInfoByIndex,
new FakeTimer(),
- state,
+ stateBundle,
statsAggregator,
1.0,
10,