Bug 2039692 - ocf:heartbeat:mysql doesnt work in replication mode
Summary: ocf:heartbeat:mysql doesnt work in replication mode
Keywords:
Status: VERIFIED
Alias: None
Deadline: 2023-05-29
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: resource-agents
Version: 8.6
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.9
Assignee: Oyvind Albrigtsen
QA Contact: cluster-qe
Steven J. Levine
URL:
Whiteboard:
Depends On:
Blocks: 2179003 1992661
TreeView+ depends on / blocked
 
Reported: 2022-01-12 09:05 UTC by Martin Juricek
Modified: 2023-08-10 15:42 UTC (History)
6 users (show)

Fixed In Version: resource-agents-4.9.0-43.el8
Doc Type: Bug Fix
Doc Text:
.The `mysql` resource agent now works correctly with promotable clone resources Previously, the `mysql` resource agent moved cloned resources that were operating in a Master role between nodes, due to promotion scores changing between promoted and non-promoted values. With this fix, a promoted node stays promoted.
Clone Of:
: 2179003 (view as bug list)
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CLUSTERQE-6607 0 None None None 2023-04-19 21:53:55 UTC
Red Hat Issue Tracker KCSOPP-1860 0 None None None 2022-06-01 15:28:03 UTC
Red Hat Issue Tracker RHELPLAN-107539 0 None None None 2022-01-12 09:10:41 UTC

Comment 3 Reid Wahl 2022-01-15 02:21:24 UTC
Could you provide sosreports? I may be able to see if I can tell what's going on from those.

Do we know if this worked in prior versions (i.e., was this configuration part of the QA setup before)?

Comment 5 Reid Wahl 2022-01-17 20:29:01 UTC
(In reply to Martin Juricek from comment #4)
> But one strange thing can be observed /var/log/messages. The master score
> periodically changes from 2->1 and back 1->2:

Looks like a bug. If the monitor succeeds for the promoted node, OCF_CHECK_LEVEL is 0 (the default), and we're not read-only, then we set the promotion score to 1 and then to 2.

~~~
mysql_monitor() {
...
    if [ $OCF_CHECK_LEVEL -gt 0 -a -n "$OCF_RESKEY_test_table" ]; then
    ...
    else
        # In case no exnteded tests are enabled and we are in master/slave mode _always_ set the master score to 1 if we reached this point
        ocf_is_ms && $CRM_MASTER -v 1
    fi

    if ocf_is_ms && ! get_read_only; then
        ocf_log debug "MySQL monitor succeeded (master)";
        # Always set master score for the master
        $CRM_MASTER -v 2
        return $OCF_RUNNING_MASTER
    else
        ocf_log debug "MySQL monitor succeeded";
        return $OCF_SUCCESS
    fi
~~~

This results in two unnecessary attribute changes every time the monitor runs for a healthy promoted node.

Comment 7 Oyvind Albrigtsen 2023-03-16 12:16:54 UTC
https://github.com/ClusterLabs/resource-agents/pull/1850

Comment 16 Oyvind Albrigtsen 2023-06-14 12:44:06 UTC
Patch to fix demoted node score bouncing between ~3600 and 1:
https://github.com/ClusterLabs/resource-agents/pull/1874


Note You need to log in before you can comment on or make changes to this bug.