ClusterLabs / ClusterLabs/resource-agents

mysql: Check for promoted node during start is invalid

Open
#1,839 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
519
Forks
608
Avg merge
6d 1h
Merged PRs (30d)
7

Description

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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the mysql resource agent's start operation and inspect how it currently reads OCF_RESKEY_CRM_meta_notify_master_uname. Run the shown crm_resource command against a stateful resource and examine its XML structure. Done means the start check obtains promoted node name(s) from the resource-location result, uses promoted terminology, and handles the reported output shape reliably.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, shell
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.