Allow tuning of Galera gcache size

Appropriate gcache.size values allow a cluster node to perform IST
instead of SST if the writes occurred during its downtime do not exceed
the size of the cache itself.
This is especially beneficial during maintenance windows.

Closes-Bug: #1939540

Change-Id: I483484c58ab703f3a4dcede636d733e23b051f63
(cherry picked from commit feed67dcc4)
(cherry picked from commit 1ce9d8855d)
(cherry picked from commit 165dcb2de0)
This commit is contained in:
Luca Miccini 2021-08-10 08:25:00 +02:00 committed by Michele Baldessari
parent d81b8211f4
commit 14d6f9ae31
1 changed files with 13 additions and 2 deletions

View File

@ -159,6 +159,10 @@
# (optional) Use --force when creating the ocf resource via pcs
# Defaults to false
#
# [*gcache_size*]
# (optional) Controls the gcache size.
# Defaults to undef
#
class tripleo::profile::pacemaker::database::mysql_bundle (
$mysql_docker_image = undef,
$control_port = 3123,
@ -189,6 +193,7 @@ class tripleo::profile::pacemaker::database::mysql_bundle (
$open_files_limit = 16384,
$promote_timeout = 300,
$force_ocf = false,
$gcache_size = undef,
) {
if $bootstrap_node and $::hostname == downcase($bootstrap_node) {
$pacemaker_master = true
@ -240,6 +245,12 @@ class tripleo::profile::pacemaker::database::mysql_bundle (
}
$cluster_host_map_string = join($host_map_array, ';')
if $gcache_size {
$gcache_options = "gcache.size=${gcache_size};"
} else {
$gcache_options = ''
}
if $enable_internal_tls {
$tls_certfile = $certificate_specs['service_certificate']
$tls_keyfile = $certificate_specs['service_key']
@ -278,9 +289,9 @@ class tripleo::profile::pacemaker::database::mysql_bundle (
$mysqld_options_sst = {}
}
if $ipv6 {
$wsrep_provider_options = "gmcast.listen_addr=tcp://[::]:4567;${tls_options}"
$wsrep_provider_options = "${gcache_options}gmcast.listen_addr=tcp://[::]:4567;${tls_options}"
} else {
$wsrep_provider_options = "gmcast.listen_addr=tcp://${gmcast_listen_addr}:4567;${tls_options}"
$wsrep_provider_options = "${gcache_options}gmcast.listen_addr=tcp://${gmcast_listen_addr}:4567;${tls_options}"
}
$mysqld_options_mysqld = {