-
Notifications
You must be signed in to change notification settings - Fork 343
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
Track node's XML ID rather than cluster ID for attribute write-outs in pacemaker-attrd #3796
base: main
Are you sure you want to change the base?
Conversation
... even if false, for code consistency and simplicity
... in write_attribute()
... for cleaner separation, and to ensure it is set whenever possible.
We only need the node XML ID for writing values to the CIB, so if a value will never be written, skip looking for the XML ID. This does mean that cluster nodes won't be added to the peer cache for unwritten attributes, but that shouldn't matter for them.
... to pcmk__cluster_get_xml_id(). It's getting the CIB XML ID; there's no such thing as a cluster-layer UUID, and it can be used with Pacemaker Remote nodes as well as cluster nodes.
... rather than using node->xml_id directly, so it gets set whenever possible. Also, make comparisons case-sensitive.
This effectively reverts 7afc160
Previously, attribute_value_t had a nodeid member to track the cluster ID of the node that the value is for. However the only reason we need it is to be able to get the node's XML ID in the CIB, for writing out the value. Rename it to node_xml_id and track the XML ID directly. In practice, there is no real change, since the CIB XML ID of Corosync nodes is simply their cluster ID as a string. This allows us to keep the same XML attribute and value in peer messages for backward compatibility. If we ever support node XML IDs that are *not* the string equivalent of their cluster IDs, rolling upgrades will be possible only from versions with this commit and later.
... for readability and to reduce code duplication
Previously, node XML IDs were kept in attribute_value_t. That meant that they were duplicated for every value for a node, the values might be known for some values and unknown or inconsistent for others, and newly learned XML IDs would have to be broadcast per value. Now, maintain a global node XML ID cache.
@@ -0,0 +1,69 @@ | |||
/* | |||
* Copyright 2024 the Pacemaker project contributors |
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.
Update the copyright date - I didn't check all the other files, but this one being new was obvious.
{ | ||
if (node_xml_ids == NULL) { | ||
node_xml_ids = pcmk__strikey_table(free, free); | ||
} |
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.
Where does node_xml_ids get freed when attrd shuts down?
No description provided.