From 9844f2fd3e1246a53f1088055c4d5f9cea703278 Mon Sep 17 00:00:00 2001 From: Liam Young Date: Wed, 24 Jul 2019 10:29:12 +0000 Subject: [PATCH] Never give up on res_mysql_monitor Configure pacemaker to never give up on the res_mysql_monitor resource and to recheck 5 seconds after a failure. This is achieved using migration-threshold and failure-timeout options *1. *1 https://clusterlabs.org/pacemaker/doc/en-US/Pacemaker/1.1/html/Pacemaker_Explained/_failure_response.html Change-Id: If19bea77eb5dee9e9eeff105ab98dce1b2de9f74 Closes-Bug: #1837401 --- hooks/percona_hooks.py | 3 ++- unit_tests/test_percona_hooks.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/hooks/percona_hooks.py b/hooks/percona_hooks.py index 13df074..9ceebc4 100755 --- a/hooks/percona_hooks.py +++ b/hooks/percona_hooks.py @@ -159,7 +159,8 @@ RES_MONITOR_PARAMS = ('params user="sstuser" password="%(sstpass)s" ' 'max_slave_lag="5" ' 'cluster_type="pxc" ' 'op monitor interval="1s" timeout="30s" ' - 'OCF_CHECK_LEVEL="1"') + 'OCF_CHECK_LEVEL="1" ' + 'meta migration-threshold=INFINITY failure-timeout=5s') MYSQL_SOCKET = "/var/run/mysqld/mysqld.sock" diff --git a/unit_tests/test_percona_hooks.py b/unit_tests/test_percona_hooks.py index d41ba73..959e7bc 100644 --- a/unit_tests/test_percona_hooks.py +++ b/unit_tests/test_percona_hooks.py @@ -147,7 +147,8 @@ class TestHARelation(CharmTestCase): 'cluster_type="pxc" ' 'op monitor interval="1s" ' 'timeout="30s" ' - 'OCF_CHECK_LEVEL="1"')}, + 'OCF_CHECK_LEVEL="1" ' + 'meta migration-threshold=INFINITY failure-timeout=5s')}, 'locations': { 'loc_mysql': ( 'grp_mysql_vips ' @@ -193,7 +194,8 @@ class TestHARelation(CharmTestCase): 'cluster_type="pxc" ' 'op monitor interval="1s" ' 'timeout="30s" ' - 'OCF_CHECK_LEVEL="1"')}, + 'OCF_CHECK_LEVEL="1" ' + 'meta migration-threshold=INFINITY failure-timeout=5s')}, 'locations': { 'loc_mysql': ( 'grp_mysql_hostnames '