diff options
author | Tor Brede Vekterli <vekterli@yahooinc.com> | 2023-07-26 13:29:50 +0200 |
---|---|---|
committer | Tor Brede Vekterli <vekterli@yahooinc.com> | 2023-07-26 13:29:50 +0200 |
commit | 8976aa9b3771ea38c5cfc6bf405254de6d1d58fb (patch) | |
tree | 8a26f72097d66c06a89245a752f44280affc23c9 /clustercontroller-core/src/main | |
parent | 8527a87e966cc58cb071f52b40ca2d07a2f6c271 (diff) |
Add content cluster name to generated feed block message
Messages now prefixed with content cluster name to help disambiguate
which cluster is exceeding its limits in multi-cluster deployments.
Example message:
```
in content cluster 'my-cool-cluster': disk on node 1 [my-node-1.example.com] is 81.0% full
(the configured limit is 80.0%). See https://docs.vespa.ai/en/operations/feed-block.html
```
Diffstat (limited to 'clustercontroller-core/src/main')
2 files changed, 7 insertions, 6 deletions
diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java index 715387fac01..01265e4236c 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/FleetController.java @@ -845,7 +845,7 @@ public class FleetController implements NodeListener, SlobrokListener, SystemSta .stateDeriver(createBucketSpaceStateDeriver()) .deferredActivation(options.enableTwoPhaseClusterStateActivation()) .feedBlock(createResourceExhaustionCalculator() - .inferContentClusterFeedBlockOrNull(cluster.getNodeInfos())) + .inferContentClusterFeedBlockOrNull(cluster)) .deriveAndBuild(); stateVersionTracker.updateLatestCandidateStateBundle(candidateBundle); invokeCandidateStateListeners(candidateBundle); diff --git a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ResourceExhaustionCalculator.java b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ResourceExhaustionCalculator.java index 732048716bb..4bc6cd1fbd2 100644 --- a/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ResourceExhaustionCalculator.java +++ b/clustercontroller-core/src/main/java/com/yahoo/vespa/clustercontroller/core/ResourceExhaustionCalculator.java @@ -78,15 +78,16 @@ public class ResourceExhaustionCalculator { } } - public static String decoratedMessage(String msg) { - // Add a user-friendly documentation link to the error message - return "%s. See https://docs.vespa.ai/en/operations/feed-block.html".formatted(msg); + public static String decoratedMessage(ContentCluster cluster, String msg) { + // Disambiguate content cluster and add a user-friendly documentation link to the error message + return "in content cluster '%s': %s. See https://docs.vespa.ai/en/operations/feed-block.html".formatted(cluster.getName(), msg); } - public ClusterStateBundle.FeedBlock inferContentClusterFeedBlockOrNull(Collection<NodeInfo> nodeInfos) { + public ClusterStateBundle.FeedBlock inferContentClusterFeedBlockOrNull(ContentCluster cluster) { if (!feedBlockEnabled) { return null; } + var nodeInfos = cluster.getNodeInfos(); var exhaustions = enumerateNodeResourceExhaustionsAcrossAllNodes(nodeInfos); if (exhaustions.isEmpty()) { return null; @@ -99,7 +100,7 @@ public class ResourceExhaustionCalculator { if (exhaustions.size() > maxDescriptions) { description += String.format(" (... and %d more)", exhaustions.size() - maxDescriptions); } - description = decoratedMessage(description); + description = decoratedMessage(cluster, description); // FIXME we currently will trigger a cluster state recomputation even if the number of // exhaustions is greater than what is returned as part of the description. Though at // that point, cluster state recomputations will be the least of your worries...! |