-
Notifications
You must be signed in to change notification settings - Fork 345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Low: libpacemaker: Don't assert on injecting nonexistent nodes. #3808
base: main
Are you sure you want to change the base?
Conversation
8fe1757
to
18f3048
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My inclination is to fix this in an even simpler way. Currently, for --node-up
, if the node doesn't exist then we simply inject it. We could do the same thing for --node-down
(which also asserts) and --node-fail
.
We haven't done that in the past, and there may be only little or no legitimate use case for it. But it seems at least as reasonable as ignoring the nonexistent node for --node-down
and --node-up
. And it seems unlikely that anyone is relying on not injecting the nonexistent node, because it's probably been asserting for a long time/forever.
To do the injection, all we have to do is set pcmk__simulate_node_config = true
to node_down_cb()
and node_fail_cb()
.
What do you think?
Actually, injecting an action that refers to a nonexistent node would run into a similar issue. There may be other commands that do too. So, two options:
|
If crm_simulate tries to inject a node up or node fail action for a nonexistent node, it'll just assert. Instead, log an error message and return NULL. That NULL then needs to be propagated up a couple layers to functions that actually expect and know how to handle errors. Fixes T945
18f3048
to
4f727f0
Compare
Rebased on main just to take a look at this again - no code changes, and not worth looking at again yet. |
The way it feels like this should work to me is: (1) If I guess I don't much see the point of a flag that's only useful if it's set and crashes sometimes if it's not set. I am inclined to do what you've outlined here, though I can see the value of erroring out on unknown nodes as a way of catching typos on the command line. |
Well, doing the obvious thing of getting rid of
|
At a glance, it seems to be because we're now creating a node object for guest nodes when we shouldn't be. Looks like during This still might be a decent path forward but we'd have to handle guest nodes differently somehow. Obviously |
If crm_simulate tries to inject a node up or node fail action for a nonexistent node, it'll just assert. Instead, log an error message and return NULL.
That NULL then needs to be propagated up a couple layers to functions that actually expect and know how to handle errors.
Fixes T945