Fix galera max connections calculation

The max connection calculation uses the number of vcpus reported by ansible
however it's using the wrong value in one portion of the calculation. The
result is that the calculation returns 0 rather than the intended 200 when
there are both x86 and POWER controllers.

Change-Id: I48314a3b701da4df6aaa0c163b14da36a1e70b7f
Closes-Bug: #1647106
(cherry picked from commit 49a010176f)
This commit is contained in:
Kyle L. Henderson 2016-12-03 16:19:59 -06:00
parent 08546d3763
commit f9cc78b33e
3 changed files with 6 additions and 3 deletions

View File

@ -1,6 +1,7 @@
{%- set all_calculated_max_connections = [] %}
{%- for galera_node in galera_cluster_members %}
{%- if all_calculated_max_connections.append((hostvars[galera_node]['ansible_processor_vcpus'] | int > 0) | ternary (ansible_processor_vcpus, 2) * 100) %}
{%- set vcpus = hostvars[galera_node]['ansible_processor_vcpus'] %}
{%- if all_calculated_max_connections.append((vcpus | int > 0) | ternary (vcpus, 2) * 100) %}
{%- endif %}
{%- endfor %}
{%- set calculated_max_connections = all_calculated_max_connections|sort %}

View File

@ -2,7 +2,8 @@
{%- set all_calculated_max_connections = [] %}
{%- for galera_node in galera_cluster_members %}
{%- set _ = all_calculated_max_connections.append((hostvars[galera_node]['ansible_processor_vcpus'] | int > 0) | ternary (ansible_processor_vcpus, 2) * 100) %}
{%- set vcpus = hostvars[galera_node]['ansible_processor_vcpus'] %}
{%- set _ = all_calculated_max_connections.append((vcpus | int > 0) | ternary (vcpus, 2) * 100) %}
{%- endfor %}
{%- set calculated_min_connections = all_calculated_max_connections | min %}
{%- set calculated_max_connections = galera_max_connections | default(calculated_min_connections) %}

View File

@ -2,7 +2,8 @@
{%- set all_calculated_max_connections = [] %}
{%- for galera_node in galera_cluster_members %}
{%- set _ = all_calculated_max_connections.append((hostvars[galera_node]['ansible_processor_vcpus'] | int > 0) | ternary (ansible_processor_vcpus, 2) * 100) %}
{%- set vcpus = hostvars[galera_node]['ansible_processor_vcpus'] %}
{%- set _ = all_calculated_max_connections.append((vcpus | int > 0) | ternary (vcpus, 2) * 100) %}
{%- endfor %}
{%- set calculated_min_connections = all_calculated_max_connections | min %}
{%- set calculated_max_connections = galera_max_connections | default(calculated_min_connections) %}