[Node] Log that an unhealthy static node is not protected from replacement - #727
Conversation
8ff4a53 to
a64dd1d
Compare
a64dd1d to
700bf86
Compare
700bf86 to
9c4a053
Compare
| # Include the node states, which carry the reason the nodes are being replaced. | ||
| log.info( | ||
| "Terminating instances backing unhealthy static nodes: %s", | ||
| print_with_count( |
There was a problem hiding this comment.
This array can potentially contain thousands of entries. Are we sure the logger would be able to handle?
There was a problem hiding this comment.
I checked whether the logger actually has a problem with the full list.
It does not: clustermgtd logs through a plain StreamHandler to stdout, and supervisord writes that to /var/log/parallelcluster/clustermgtd with stdout_logfile_maxbytes = 0, i.e. no size cap and no rotation on that stream. There is no line-length limit anywhere in that path.
More to the point, the surrounding logs already print full lists of the same size — Found the following unhealthy static nodes listed every node before this PR, and delete_instances logs every instance id. So this does not introduce a new order of magnitude.
I also moved the states onto the existing Found the following unhealthy static nodes line instead of adding a second duplicated line about the same set of nodes, so the node names and their states are reported together and Terminating instances backing unhealthy static nodes is left untouched:
Found the following unhealthy static nodes: (x1) ['queue1-st-cr1-1(192.168.104.165) in state DOWN+CLOUD']
9c4a053 to
6991e81
Compare
…ement A static node being replaced is shielded from being replaced again while it bootstraps. When that protection did not apply, the logs did not say so, making it hard to tell why a node under replacement was terminated again. Report, when a DOWN or DRAINED static node is found unhealthy, that the node is not within the replacement protection window and that it will be replaced, and include the node states in the log listing the unhealthy static nodes. The node state carries the reason, so the logging does not assume a specific cause. Also fix the format string of the debug log covering the opposite case, which was missing a placeholder and raised a logging error whenever a node under replacement was found DOWN.
6991e81 to
41ff2d5
Compare
Description of changes
A static node that clustermgtd is replacing is shielded from being replaced again while it bootstraps (the replacement protection window). When that protection did not apply, the logs never said so: they showed the node being terminated and relaunched with no indication that it had lost, or never had, the grace period. This is what made the maintenance reservation issue hard to diagnose, and the same gap affects every other reason a node can end up unprotected.
scontroloutput.The node state carries the reason, so the logging does not assume a specific cause and stays accurate if the conditions change.
This also fixes the format string of the debug log covering the opposite case (node still protected), which was missing a placeholder and raised
TypeError: not all arguments converted during string formattingwhenever it was emitted.Example
A node being replaced fails its EC2 health check while bootstrapping, so it is removed from the replacement set and replaced again immediately:
A DRAINED node reads the same way:
While a node is inside the protection window it is reported as healthy and only a debug line is emitted, so the warning above only shows up for nodes that are not shielded.
Tests
DevSettings/NodePackage.References
Checklist
developadd the branch name as prefix in the PR title (e.g.[release-3.6]).Please review the guidelines for contributing and Pull Request Instructions.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.