Make promote timeout configurable

Allow override of galera promote timeout

This commit removes the hard coded value of pacemaker promote time out
(currently 300s), and allows operators to override it via:

tripleo::profile::pacemaker::database::mysql::promote_timeout
tripleo::profile::pacemaker::database::mysql_bundle::promote_timeout

Closes-Bug: #1883896
Change-Id: I96f5d349b94f05f4f66db6b85ba481deba0015d9
This commit is contained in:
Damien Ciabrini 2020-06-17 10:58:01 +02:00
parent 165b9c5c57
commit 0606e22e24
2 changed files with 15 additions and 2 deletions

View File

@ -97,6 +97,11 @@
# (Optional) Maximum value for open-files-limit
# Defaults to 16384
#
# [*promote_timeout*]
# (Optional) Maximum time in second for starting up a galera server
# before pacemaker considers the operation timed out.
# Defaults to 300
#
class tripleo::profile::pacemaker::database::mysql (
$bootstrap_node = hiera('mysql_short_bootstrap_node_name'),
$bind_address = $::hostname,
@ -113,6 +118,7 @@ class tripleo::profile::pacemaker::database::mysql (
$step = Integer(hiera('step')),
$pcs_tries = hiera('pcs_tries', 20),
$open_files_limit = 16384,
$promote_timeout = 300,
) {
if $bootstrap_node and $::hostname == downcase($bootstrap_node) {
$pacemaker_master = true
@ -252,7 +258,7 @@ class tripleo::profile::pacemaker::database::mysql (
if $pacemaker_master {
pacemaker::resource::ocf { 'galera' :
ocf_agent_name => 'heartbeat:galera',
op_params => 'promote timeout=300s on-fail=block',
op_params => "promote timeout=${promote_timeout}s on-fail=block",
master_params => '',
meta_params => "master-max=${galera_nodes_count} ordered=true",
resource_params => "additional_parameters='--open-files-limit=${open_files_limit}' enable_creation=true wsrep_cluster_address='gcomm://${galera_nodes}' cluster_host_map='${cluster_host_map}'",

View File

@ -145,9 +145,15 @@
# (Optional) Maximum value for open-files-limit
# Defaults to 16384
#
# [*promote_timeout*]
# (Optional) Maximum time in second for starting up a galera server
# before pacemaker considers the operation timed out.
# Defaults to 300
#
# [*force_ocf*]
# (optional) Use --force when creating the ocf resource via pcs
# Defaults to false
#
class tripleo::profile::pacemaker::database::mysql_bundle (
$mysql_docker_image = undef,
$control_port = 3123,
@ -175,6 +181,7 @@ class tripleo::profile::pacemaker::database::mysql_bundle (
$pcs_tries = hiera('pcs_tries', 20),
$step = Integer(hiera('step')),
$open_files_limit = 16384,
$promote_timeout = 300,
$force_ocf = false,
) {
if $bootstrap_node and $::hostname == downcase($bootstrap_node) {
@ -483,7 +490,7 @@ MYSQL_HOST=localhost\n",
ocf_agent_name => 'heartbeat:galera',
master_params => '',
meta_params => "master-max=${galera_nodes_count} ordered=true container-attribute-target=host",
op_params => 'promote timeout=300s on-fail=block',
op_params => "promote timeout=${promote_timeout}s on-fail=block",
resource_params => "log='/var/log/mysql/mysqld.log' additional_parameters='--open-files-limit=${open_files_limit}' enable_creation=true wsrep_cluster_address='gcomm://${galera_nodes}' cluster_host_map='${cluster_host_map_string}'",
tries => $pcs_tries,
location_rule => {