diff options
author | Geir Storli <geirst@verizonmedia.com> | 2021-02-08 17:42:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-08 17:42:44 +0100 |
commit | b7bc3af0d5369f704b941835e39f2a40df508f9f (patch) | |
tree | bb2f8ead4660626ac3444655ab081bdc19a26e49 | |
parent | 3cce2f1404a3055557898a3ed3ca9434f9b55f33 (diff) | |
parent | 681d5dc218839085b01535bbd9fd351217fb3f8b (diff) |
Merge pull request #16440 from vespa-engine/vekterli/add-detailed-per-node-feed-block-row-to-status-page
Add extra row under content node if it's blocking feed
2 files changed, 37 insertions, 0 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeResourceExhaustion.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeResourceExhaustion.java index c730350310c..8d0a873a801 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeResourceExhaustion.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/NodeResourceExhaustion.java @@ -53,6 +53,13 @@ public class NodeResourceExhaustion { return String.format("%s (<= %.3g)", makeDescriptionPrefix(), limit); } + public String toShorthandDescription() { + return String.format("%s%s %.3g > %.3g", + resourceType, + (resourceUsage.getName() != null ? ":" + resourceUsage.getName() : ""), + resourceUsage.getUsage(), limit); + } + private String makeDescriptionPrefix() { return String.format("%s%s on node %d [%s]", resourceType, diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/statuspage/VdsClusterHtmlRenderer.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/statuspage/VdsClusterHtmlRenderer.java index ac4cb25a9c1..6d2f66d76d5 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/statuspage/VdsClusterHtmlRenderer.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/status/statuspage/VdsClusterHtmlRenderer.java @@ -14,6 +14,7 @@ import java.util.List; import java.util.Map; import java.util.TimeZone; import java.util.TreeMap; +import java.util.stream.Collectors; /** * Renders web page with cluster status. @@ -205,6 +206,35 @@ public class VdsClusterHtmlRenderer { addRpcAddress(nodeInfo, row); table.addRow(row); + if (nodeType.equals(NodeType.STORAGE)) { + addFeedBlockedRowIfNodeIsBlocking(stateBundle, nodeInfo, row); + } + } + } + + private void addFeedBlockedRowIfNodeIsBlocking(ClusterStateBundle stateBundle, NodeInfo nodeInfo, HtmlTable.Row nodeRow) { + // We only show a feed block row if the node is actually blocking feed in the cluster, not + // just if limits have been exceeded (as feed block may be config disabled). + // O(n) but n expected to be 0-(very small number) in all realistic cases. + if (stateBundle.clusterFeedIsBlocked()) { + var exhaustions = stateBundle.getFeedBlockOrNull().getConcreteExhaustions().stream() + .filter(ex -> ex.node.getIndex() == nodeInfo.getNodeIndex()) + .collect(Collectors.toList()); + if (!exhaustions.isEmpty()) { + var exhaustionsDesc = exhaustions.stream() + .map(NodeResourceExhaustion::toShorthandDescription) + .collect(Collectors.joining(", ")); + + HtmlTable.Row feedBlockRow = new HtmlTable.Row(); + var contents = String.format("<strong>Node is blocking feed: %s</strong>", HtmlTable.escape(exhaustionsDesc)); + var cell = new HtmlTable.Cell(contents).addProperties(ERROR_PROPERTY); + cell.addProperties(new HtmlTable.CellProperties().setColSpan(18)); + feedBlockRow.addCell(cell); + table.addRow(feedBlockRow); + // Retroactively make the node index cell span 2 rows so it's obvious (hopefully) + // what node the feed block state is related to. + nodeRow.cells.get(0).addProperties(new HtmlTable.CellProperties().setRowSpan(2)); + } } } |