From 83665fa55dc66388bd134136ac09c30fb93a99eb Mon Sep 17 00:00:00 2001 From: Tor Brede Vekterli Date: Tue, 19 Mar 2019 15:24:55 +0100 Subject: 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. --- .../vespa/clustercontroller/core/ContentCluster.java | 2 +- .../core/status/LegacyIndexPageRequestHandler.java | 2 +- .../core/status/statuspage/VdsClusterHtmlRendrer.java | 17 +++++++++++------ .../core/ContentClusterHtmlRendrerTest.java | 7 +++++-- 4 files changed, 18 insertions(+), 10 deletions(-) (limited to 'clustercontroller-core/src') 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 storageNodeInfos, final TreeMap 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 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.
\n") .append("4) SSV - System state version - The latest system state version the node has " + - "acknowledged.
\n") + "acknowledged (last activated state version in parentheses if this is not equal to SSV).
\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) + ".
\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, -- cgit v1.2.3