ClusterLabs / resource-agents

Combined repository of OCF agents from the RHCS and Linux-HA projects
GNU General Public License v2.0
493 stars 579 forks source link

mysql: Check for promoted node during start is invalid #1839

Open nrwahl2 opened 1 year ago

nrwahl2 commented 1 year ago

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:

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.

oalbrigt commented 1 year ago

Makes sense to me.

According to Damien multi-promoted doesnt handle conflicts, so they would have to use galera for that use-case.