Decrease TCP retries in case of VIP failover

In case of VIP failover some connections (like mysql) can stuck
in retrying to connect and detect a dead connection. We
should probably make this failover to be detected faster then the
default value as suggested in [1]

[1] https://access.redhat.com/solutions/726753

Change-Id: Ia51f7f8f5225c4e350760093686858eabb3fec8a
Related-Bug: #1917068
This commit is contained in:
Dmitriy Rabotyagov
2021-03-01 18:25:00 +02:00
committed by Georgina Shippey
parent ad16d023a3
commit e479735681
2 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
---
features:
- |
Added variable ``keepalived_sysctl_tcp_retries`` that allows to control
number of retries kernel will make to give up on connection. It controls
net.ipv4.tcp_retries2 sysctl setting which default value of which is 15.
Default value of ``keepalived_sysctl_tcp_retries`` is 8, so VIP failover
time will be ~1min. Setting ``keepalived_sysctl_tcp_retries`` to 0 will
remove mentioned sysctl setting.

View File

@@ -74,6 +74,15 @@
tags:
- openstack_hosts-install
- name: Decreasing tcp_retries2 sysctl
sysctl:
name: "net.ipv4.tcp_retries2"
value: "{{ keepalived_sysctl_tcp_retries | default(8) }}"
sysctl_set: yes
state: "{{ (keepalived_sysctl_tcp_retries | default(8) > 0) | ternary('present', 'absent') }}"
reload: yes
failed_when: false
- name: Install distro packages
package:
name: "{{ openstack_host_distro_packages }}"