From 0606e22e245761f66baff3eb8846473d2eab5be3 Mon Sep 17 00:00:00 2001 From: Damien Ciabrini Date: Wed, 17 Jun 2020 10:58:01 +0200 Subject: [PATCH] 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 --- manifests/profile/pacemaker/database/mysql.pp | 8 +++++++- manifests/profile/pacemaker/database/mysql_bundle.pp | 9 ++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/manifests/profile/pacemaker/database/mysql.pp b/manifests/profile/pacemaker/database/mysql.pp index c74c444b0..d3902d373 100644 --- a/manifests/profile/pacemaker/database/mysql.pp +++ b/manifests/profile/pacemaker/database/mysql.pp @@ -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}'", diff --git a/manifests/profile/pacemaker/database/mysql_bundle.pp b/manifests/profile/pacemaker/database/mysql_bundle.pp index c7225cdb3..fbd02c4a9 100644 --- a/manifests/profile/pacemaker/database/mysql_bundle.pp +++ b/manifests/profile/pacemaker/database/mysql_bundle.pp @@ -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 => {