dynamic_pool_size_mb defaults to 0

Bug #2060253 reported by Jay Jahns
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kolla-ansible
New
Undecided
Unassigned

Bug Description

We are doing performance / scale testing on a deployment of 2023.2 handled by kolla-ansible. In doing some investigation, we found that the following code defaults to a value of 0, which doesn't appear to be correct.

The issue appears to be the round function. It causes the value to immediately go to 0.0.

This is in the galera.cnf.j2 template in the mariadb role.

{% set dynamic_pool_size_mb = (hostvars[inventory_hostname].ansible_facts.memtotal_mb * 0.4) | round | int %}
{% if dynamic_pool_size_mb < 8192 %}
innodb_buffer_pool_size = '{{ dynamic_pool_size_mb }}M'
{% else %}
innodb_buffer_pool_size = '8192M'
{% endif %}

I found that running this manually (memtotal_mb * 0.4) produces a value, but when the round occurs, it goes to 0.0.

ansible -i hosts -m debug -a 'msg={{ ansible_facts.memtotal_mb * 0.4 }}' hostname
hostname | SUCCESS => {
    "msg": "412391.60000000003"
}

And then with the round:

ansible -i hosts -m debug -a 'msg={{ ansible_facts.memtotal_mb * 0.4 | round }}' hostname
hostname | SUCCESS => {
    "msg": "0.0"
}

That seems more like an ansible bug than anything else, but I want to get someone to look at this and confirm.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.