From de5181509f43f48ea173d7d8d1b0ea8e5ca2e7c3 Mon Sep 17 00:00:00 2001 From: Povilas Vaitkus Date: Fri, 27 Oct 2023 11:22:25 +0300 Subject: [PATCH] Fixes after sync with upstream --- .github/workflows/ci.yml | 10 +--------- attributes/default.rb | 2 ++ libraries/helpers.rb | 8 +++++++- metadata.rb | 6 +++--- recipes/configure_server.rb | 4 +++- templates/my.cnf.cluster.erb | 15 +++++++++++---- 6 files changed, 27 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 570fe5c1..2a8d0e55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,16 +23,8 @@ jobs: strategy: matrix: os: - - almalinux-8 - - almalinux-9 - centos-7 - - centos-stream-8 - - centos-stream-9 - - debian-10 - - debian-11 - - ubuntu-1804 - - ubuntu-2004 - - ubuntu-2204 + - rockylinux-8 suite: - client-57 - client-80 diff --git a/attributes/default.rb b/attributes/default.rb index 906956c5..55410378 100644 --- a/attributes/default.rb +++ b/attributes/default.rb @@ -216,10 +216,12 @@ default['percona']['cluster']['wsrep_node_name'] = '' default['percona']['cluster']['wsrep_notify_cmd'] = '' default['percona']['cluster']['wsrep_sst_auth'] = '' +default['percona']['cluster']['pxc_encrypt_cluster_traffic'] = 'OFF' # These both are used to build wsrep_sst_receive_address default['percona']['cluster']['wsrep_sst_receive_interface'] = nil # Works like node["percona"]["server"]["bind_to"] default['percona']['cluster']['wsrep_sst_receive_port'] = '4444' +default['percona']['cluster']['wsrep_node_address'] = nil default['percona']['cluster']['innodb_locks_unsafe_for_binlog'] = 1 default['percona']['cluster']['innodb_autoinc_lock_mode'] = 2 diff --git a/libraries/helpers.rb b/libraries/helpers.rb index befea141..5b7ded55 100644 --- a/libraries/helpers.rb +++ b/libraries/helpers.rb @@ -93,7 +93,13 @@ def percona_backup_package node['platform_version'].to_f >= 20.04 ? 'percona-xtrabackup-80' : 'xtrabackup' end when 'rhel' - node['platform_version'].to_i >= 8 ? 'percona-xtrabackup-80' : 'percona-xtrabackup' + if node['percona']['version'].to_i >= 8 + 'percona-xtrabackup-80' + elsif node['percona']['version'] == '5.7' + 'percona-xtrabackup-24' + else + 'percona-xtrabackup' + end end end diff --git a/metadata.rb b/metadata.rb index da13cdc7..ce309302 100644 --- a/metadata.rb +++ b/metadata.rb @@ -3,9 +3,9 @@ maintainer_email 'help@sous-chefs.org' license 'Apache-2.0' description 'Installs Percona MySQL client and server' -source_url 'https://github.com/sous-chefs/percona' -issues_url 'https://github.com/sous-chefs/percona/issues' -version '3.4.4' +source_url 'https://github.com/hostinger/chef-percona' +issues_url 'https://github.com/hostinger/chef-percona/issues' +version '5.11.21' chef_version '>= 16.0' depends 'yum' diff --git a/recipes/configure_server.rb b/recipes/configure_server.rb index 72e10285..080f4405 100644 --- a/recipes/configure_server.rb +++ b/recipes/configure_server.rb @@ -136,7 +136,9 @@ end if Array(server['role']).include?('cluster') - wsrep_sst_auth = if node['percona']['cluster']['wsrep_sst_auth'] == '' + wsrep_sst_auth = if node['percona']['version'].to_f > 5.7 + '' + elsif node['percona']['cluster']['wsrep_sst_auth'] == '' "#{node['percona']['backup']['username']}:#{passwords.backup_password}" else node['percona']['cluster']['wsrep_sst_auth'] diff --git a/templates/my.cnf.cluster.erb b/templates/my.cnf.cluster.erb index 0863409b..2f41bce7 100644 --- a/templates/my.cnf.cluster.erb +++ b/templates/my.cnf.cluster.erb @@ -91,12 +91,19 @@ wsrep_sst_method = <%= node["percona"]["cluster"]["wsrep_sst_metho wsrep_node_name = <%= node["percona"]["cluster"]["wsrep_node_name"] %> wsrep_notify_cmd = <%= node["percona"]["cluster"]["wsrep_notify_cmd"] %> wsrep_sst_receive_address = <%= node["percona"]["cluster"]["wsrep_sst_receive_address"] %> +<% if node["percona"]["cluster"]["wsrep_node_address"] %> +wsrep_node_address = <%= node["percona"]["cluster"]["wsrep_node_address"] %> +<% end -%> <% unless @wsrep_sst_auth.empty? -%> wsrep_sst_auth = "<%= @wsrep_sst_auth %>" <% end -%> +<% if node["percona"]["version"].to_f < 5.7 %> innodb_locks_unsafe_for_binlog = <%= node["percona"]["cluster"]["innodb_locks_unsafe_for_binlog"] %> +<% end -%> innodb_autoinc_lock_mode = <%= node["percona"]["cluster"]["innodb_autoinc_lock_mode"] %> - +<%- if node["percona"]["version"].to_f >= 8.0 %> +pxc_encrypt_cluster_traffic = <%= node["percona"]["cluster"]["pxc_encrypt_cluster_traffic"] %> +<% end %> <% if @old_passwords %> # @@ -301,7 +308,7 @@ log-queries-not-using-indexes = <%= node["percona"]["server"]["log_queries_not_u # is required for both source and replica hosts. It defaults to 1 if # "master-host" is not set, but will MySQL will not function as a source # if it is omitted. -# server-id = <%= node["percona"]["server"]["server_id"] %> +server-id = <%= node["percona"]["server"]["server_id"] %> <% unless node["percona"]["server"]["replication"]["ignore_db"].empty? %> # Tells the replica SQL thread not to replicate any statement where the default database is. @@ -489,9 +496,9 @@ innodb_additional_mem_pool_size = <%= node["percona"]["server"]["innodb_addition innodb_buffer_pool_size = <%= node["percona"]["server"]["innodb_buffer_pool_size"] %> innodb_buffer_pool_instances = <%= node["percona"]["server"]["innodb_buffer_pool_instances"] %> - +<%- if node["percona"]["version"].to_f < 5.7 %> innodb_buffer_pool_populate = <%= node["percona"]["server"]["innodb_buffer_pool_populate"] %> - +<%- end %> # InnoDB stores data in one or more data files forming the tablespace. # If you have a single logical drive for your data, a single # autoextending file would be good enough. In other cases, a single file