-
Notifications
You must be signed in to change notification settings - Fork 336
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
Fix: libpacemaker: Get container attr from assigned node, if any #3132
Conversation
This commit adds a new pe__rsc_node flag enum containing values for assigned, current, and pending. This indicates the criterion used to look up a resource's location. After a compatibility break, native_location() could use these flags instead of an int. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Use enum pe__rsc_node in pe_node_attribute_calculated() to determine which container host (assigned or current) to get the attribute value from. For now, there's no use case for pending. Pass pe__rsc_node_current for existing calls, since that maintains the existing behavior. Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
promotion_attr_value() should get a container's promotion score from the host to which it's assigned (if it's been assigned), rather than the host on which it's running. Ref T489 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
Update outputs after previous commit (get container's promotion score from assigned host). There are a few changes to scores, as well as dot and exp files. The behavior in the bundle-interleave-start test appears to be an improvement. Ref T489 Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
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.
Beautiful
|
||
CRM_CHECK((rsc != NULL) && (node != NULL) && (name != NULL), return NULL); | ||
|
||
if (pcmk_is_set(rsc->flags, pe_rsc_provisional)) { |
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.
I wonder if pe_node_attribute_calculated()
should do this on its own instead of taking an argument... which would eliminate the need for the enum pe__rsc_node
type altogether (until a compatibility break, when we can use it to replace the magic int argument of native_location()
). Although I guess we could pass an enum pe__rsc_node
to native_location()
even now as long as we don't change the signature, since the values are defined as {0, 1, 2}
.
The only other caller of pe_node_attribute_calculated()
is get_node_score()
, which gets called only at unpack time.
I hadn't looked too closely at the callers this time around, just cleaned up my old commits.
promotion_attr_value()
should get a container's promotion score from the host to which it's assigned (if it's been assigned), rather than the host on which it's running.This is adapted from the first part of old PR #2313.