Skip to content

Commit

Permalink
assorted fixes for Percona XtraDB 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fraenki committed Aug 8, 2024
1 parent 0d56734 commit d12c286
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 10 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,21 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
* Add support for new operating systems

### Changed
* Disable option `pxc-encrypt-cluster-traffic` on Percona XtraDB 8.0
* Change default version of Codership/MySQL to 8.0
* Change default version of MariaDB to 10.11
* Change default version of Percona XtraDB to 8.0
* Enable systemd-based status check on RHEL 9, Debian 12 and Ubuntu 24.04 ([#191])
* Add new dependency for systemd-based status check ([#191])
* Merge internal $default_options from multiple hierarchy levels
* Extend unit tests ([#191])

### Fixed
* SST package install fails because repo is not yet configured
* Fix Percona XtraDB 8.0 package name on Debian/Ubuntu
* Fix Percona XtraDB 8.0 bootstrap command
* Fix Percona XtraDB `my.cnf` location on RHEL-based systems
* Percona XtraDB 8.0 no longer supports option `wsrep_sst_auth`

## [3.2.1] - 2024-03-13

Expand Down
6 changes: 6 additions & 0 deletions data/Debian-family.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,12 @@ galera::percona::57::galera_package_name: 'percona-xtradb-cluster-galera-3.x'
galera::percona::57::mysql_package_name: 'percona-xtradb-cluster-server-5.7'

galera::percona::80::arbitrator_package_name: 'percona-xtradb-cluster-garbd'
galera::percona::80::bootstrap_command: >
sed -i 's@ExecStart=/usr/sbin/mysqld@ExecStart=/usr/sbin/mysqld --wsrep-new-cluster@' /usr/lib/systemd/system/mysql.service;
systemctl daemon-reload;
systemctl start mysqld;
sed -i 's@ExecStart=/usr/sbin/mysqld --wsrep-new-cluster@ExecStart=/usr/sbin/mysqld@' /usr/lib/systemd/system/mysql.service;
systemctl daemon-reload
galera::percona::80::client_package_name: 'percona-xtradb-cluster-client'
# In XtraDB Cluster 8.0 there is no "galera" package anymore.
galera::percona::80::galera_package_name: 'percona-xtradb-cluster-galera'
Expand Down
8 changes: 7 additions & 1 deletion data/RedHat-family.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,12 @@ galera::percona::57::mysql_package_name: 'Percona-XtraDB-Cluster-57'
galera::percona::80::additional_packages:
- 'nmap'
galera::percona::80::arbitrator_package_name: 'percona-xtradb-cluster-garbd'
galera::percona::80::bootstrap_command: 'systemctl start [email protected]'
galera::percona::80::bootstrap_command: >
sed -i 's@ExecStart=/usr/sbin/mysqld@ExecStart=/usr/sbin/mysqld --wsrep-new-cluster@' /usr/lib/systemd/system/mysql.service;
systemctl daemon-reload;
systemctl start mysqld;
sed -i 's@ExecStart=/usr/sbin/mysqld --wsrep-new-cluster@ExecStart=/usr/sbin/mysqld@' /usr/lib/systemd/system/mysql.service;
systemctl daemon-reload
galera::percona::80::client_package_name: 'percona-xtradb-cluster-client'
# In XtraDB Cluster 8.0 there is no "galera" package anymore.
galera::percona::80::galera_package_name: 'percona-xtradb-cluster-galera'
Expand All @@ -163,6 +168,7 @@ galera::percona::arbitrator_config_file: '/etc/sysconfig/garb'
galera::percona::arbitrator_package_name: 'Percona-XtraDB-Cluster-garbd-3'
galera::percona::arbitrator_service_name: 'garb'
galera::percona::bootstrap_command: 'systemctl start [email protected]'
galera::percona::config_file: '/etc/my.cnf'
galera::percona::default_options:
mysqld:
log-error: '/var/log/mysqld.log'
Expand Down
22 changes: 21 additions & 1 deletion data/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ galera::default_options:
wsrep_node_incoming_address: "<%= $local_ip %>"
wsrep_on: 'ON'
wsrep_provider: "<%= $params['libgalera_location'] %>"
wsrep_sst_auth: "\"<%= $wsrep_sst_auth_real %>\""
wsrep_sst_method: "<%= $wsrep_sst_method %>"
wsrep_sst_receive_address: "<%= $local_ip %>"
galera::epel_needed: false
Expand Down Expand Up @@ -95,11 +94,32 @@ galera::percona::additional_packages:
galera::mariadb::additional_packages:
- 'nmap'

galera::codership::default_options:
mysqld:
wsrep_sst_auth: "\"<%= $wsrep_sst_auth_real %>\""
galera::codership::default_version: '8.0'
galera::codership::galera_package_ensure: 'present'

# Percona XtraDB removed support for wsrep_sst_auth in version 8.0,
# hence it should only be configured in older versions.
galera::percona::56::default_options:
mysqld:
wsrep_sst_auth: "\"<%= $wsrep_sst_auth_real %>\""
galera::percona::57::default_options:
mysqld:
wsrep_sst_auth: "\"<%= $wsrep_sst_auth_real %>\""
galera::percona::80::default_options:
mysqld:
# On XtraDB 8.0 the option pxc-encrypt-cluster-traffic is enabled by
# default. Disable it to make it easier to bootstrap new clusters.
pxc-encrypt-cluster-traffic: 'OFF'
galera::percona::default_version: '8.0'
# Percona does not allow installation of wsrep-enabled server and wsrep provider.
galera::percona::galera_package_ensure: 'absent'

galera::mariadb::default_options:
mysqld:
wsrep_sst_auth: "\"<%= $wsrep_sst_auth_real %>\""
galera::mariadb::default_version: '10.11'
galera::mariadb::galera_package_ensure: 'present'

Expand Down
19 changes: 12 additions & 7 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -451,12 +451,12 @@
}

# Lookup vendor specific options for MySQL/MariaDB.
$_defaults_vendor = lookup("${module_name}::${vendor_type}::${vendor_version_internal}::default_options", { default_value => undef }) ? {
undef => lookup("${module_name}::${vendor_type}::default_options", { default_value => {} }),
default => lookup("${module_name}::${vendor_type}::${vendor_version_internal}::default_options", { default_value => {} }),
}
$_defaults_vendor = lookup("${module_name}::${vendor_type}::default_options", { default_value => {} })
$_defaults_vendor_version = lookup("${module_name}::${vendor_type}::${vendor_version_internal}::default_options", { default_value => {} })
# Merge results, the version-specific values take precedence.
$_default_pre = deep_merge($_defaults_vendor, $_defaults_vendor_version)
# Now merge the vendor specific options with the global default values.
$_default_tmp = deep_merge($default_options, $_defaults_vendor)
$_default_tmp = deep_merge($default_options, $_default_pre)

# XXX: The following is sort-of a compatibility layer. It passes all options
# to the inline_epp() function. This way it is possible to use the values of
Expand Down Expand Up @@ -517,13 +517,17 @@
}

if $configure_repo {
# Ensure that repos are setup before trying to install packages.
$_packages_require = [Class['galera::repo']]
include galera::repo
unless $galera::arbitrator {
if ($galera::params['galera_package_name']) {
Class['galera::repo'] -> Package[$galera::params['galera_package_name']]
}
Class['galera::repo'] -> Class['mysql::server']
}
} else {
$_packages_require = []
}

if $configure_firewall {
Expand Down Expand Up @@ -560,8 +564,9 @@
if ($manage_additional_packages and $additional_packages_real) {
stdlib::ensure_packages($additional_packages_real,
{
ensure => $package_ensure,
before => $_packages_before,
ensure => $package_ensure,
before => $_packages_before,
require => $_packages_require,
})
}

Expand Down
4 changes: 3 additions & 1 deletion spec/acceptance/galera_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ class { 'galera':
}
},
vendor_type => 'percona',
vendor_version => '8.0'
vendor_version => '8.0',
# XtraDB 8 does not support the default SST method 'rsync'
wsrep_sst_method => 'xtrabackup-v2',
}
MANIFEST
end
Expand Down

0 comments on commit d12c286

Please sign in to comment.