Skip to content

Commit

Permalink
Fixes after sync with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
PovilasV1 committed Oct 30, 2023
1 parent 1dc16eb commit 2b067bb
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
2 changes: 2 additions & 0 deletions attributes/default.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 7 additions & 1 deletion libraries/helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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'
version '5.11.21'
chef_version '>= 16.0'

depends 'yum'
Expand Down
4 changes: 3 additions & 1 deletion recipes/configure_server.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
15 changes: 11 additions & 4 deletions templates/my.cnf.cluster.erb
Original file line number Diff line number Diff line change
Expand Up @@ -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 %>
#
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2b067bb

Please sign in to comment.