Skip to content

Commit

Permalink
Merge pull request #107 from eRadical/wsrep_slave_threads
Browse files Browse the repository at this point in the history
Extra options for wsrep_slave_threads
  • Loading branch information
mrlesmithjr authored Jan 25, 2022
2 parents 481508e + 26b43f8 commit 7e0e692
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
5 changes: 5 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ galera_wsrep_node_address: "{{ galera_cluster_bind_address }}:{{ galera_wsrep_no
# Defines wsrep node port
galera_wsrep_node_address_port: 4567

# Define the number of wsrep_slave_threads:
# - if `auto` we will use "number of vCPUs - 1"
# - else the value define here is used
galera_wsrep_slave_threads: 1

# Define the name of the cluster
galera_cluster_name: "vagrant-test"

Expand Down
6 changes: 5 additions & 1 deletion templates/etc/my.cnf.d/server.cnf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ innodb_autoinc_lock_mode=2
bind-address={{ mariadb_bind_address }}
#
# Optional setting
#wsrep_slave_threads=1
{% if galera_wsrep_slave_threads == "auto" %}
wsrep_slave_threads={{ 1 if (ansible_processor_vcpus <= 1) else (ansible_processor_vcpus - 1) }}
{% else %}
wsrep_slave_threads={{ galera_wsrep_slave_threads }}
{% endif %}
#innodb_flush_log_at_trx_commit=0

{% if galera_enable_galera_monitoring_script %}
Expand Down
6 changes: 5 additions & 1 deletion templates/etc/my.cnf.d/server.cnf.temp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,11 @@ innodb_autoinc_lock_mode=2
bind-address={{ mariadb_bind_address }}
#
# Optional setting
#wsrep_slave_threads=1
{% if galera_wsrep_slave_threads == "auto" %}
wsrep_slave_threads={{ 1 if (ansible_processor_vcpus <= 1) else (ansible_processor_vcpus - 1) }}
{% else %}
wsrep_slave_threads={{ galera_wsrep_slave_threads }}
{% endif %}
#innodb_flush_log_at_trx_commit=0

{% if galera_enable_galera_monitoring_script %}
Expand Down

0 comments on commit 7e0e692

Please sign in to comment.