Bug 2039692

Summary: ocf:heartbeat:mysql doesnt work in replication mode
Product: Red Hat Enterprise Linux 8 Reporter: Martin Juricek <mjuricek>
Component: resource-agentsAssignee: Oyvind Albrigtsen <oalbrigt>
Status: CLOSED ERRATA QA Contact: cluster-qe <cluster-qe>
Severity: unspecified Docs Contact: Steven J. Levine <slevine>
Priority: unspecified    
Version: 8.6CC: agk, cluster-maint, fdinitto, nwahl, sbradley, slevine
Target Milestone: rcKeywords: Triaged
Target Release: 8.9Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
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.
Story Points: ---
Clone Of:
: 2179003 (view as bug list) Environment:
Last Closed: 2023-11-14 15:22:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1992661, 2179003    
Deadline: 2023-05-29   

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

Comment 25 errata-xmlrpc 2023-11-14 15:22:28 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (resource-agents bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:6899