From 14d6f9ae31cfa067a6c75bf28d47ca3e052c29e1 Mon Sep 17 00:00:00 2001 From: Luca Miccini Date: Tue, 10 Aug 2021 08:25:00 +0200 Subject: [PATCH] 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 feed67dcc45eb3da818cc2ceac8cb3682a2b6364) (cherry picked from commit 1ce9d8855db0e282a4a0c47e9afdee3f7a102c39) (cherry picked from commit 165dcb2de05958c68e7e3ed46cd87b72c4f546fc) --- .../profile/pacemaker/database/mysql_bundle.pp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/manifests/profile/pacemaker/database/mysql_bundle.pp b/manifests/profile/pacemaker/database/mysql_bundle.pp index d9994d2e9..d17ccdeda 100644 --- a/manifests/profile/pacemaker/database/mysql_bundle.pp +++ b/manifests/profile/pacemaker/database/mysql_bundle.pp @@ -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 = {