resource-agents
resource-agents copied to clipboard
mysql: Check for promoted node during start is invalid
The mysql agent checks the OCF_RESKEY_CRM_meta_notify_master_uname meta attribute during the start operation to determine which node (if any) is already promoted. This has a few issues:
- It doesn't work. That meta attribute is set only during certain notify operations -- not during start operations.
- The "master" terminology is deprecated in favor of "promoted."
- If there are multiple promoted nodes (probably not possible in practice for
mysql, but I'm not sure), then the parsing will probably break.
The main issue of course is that it doesn't work. I'd suggest something like crm_resource --resource <rsc_name> --locate --output-as=xml and then grabbing the node name(s) from the XML output where state="promoted".
# crm_resource -r stateful --locate --output-as=xml
<pacemaker-result api-version="2.28" request="crm_resource -r stateful --locate --output-as=xml">
<nodes resource="stateful">
<node state="promoted">fastvm-rhel-9-0-42</node>
<node>fastvm-rhel-9-0-41</node>
</nodes>
<status code="0" message="OK"/>
</pacemaker-result>
The best practice is for tools to parse the XML output, since the text output format may change.
Makes sense to me.
According to Damien multi-promoted doesnt handle conflicts, so they would have to use galera for that use-case.