From 0a9f587015176723768a8a861265fda797c5d52e Mon Sep 17 00:00:00 2001 From: Gregory Thiemonge Date: Thu, 23 May 2019 13:55:19 +0200 Subject: [PATCH] Fixed down server issue after reloading keepalived When removing a UDP health monitor, keepalived is reloaded with a configuration without any checkers. But if keepalived has previously detected a down server, the state of the server is unchanged and it will never be added to the list of IPVS servers. Restarting keepalived on configuration change works around this issue. This issue is fixed in keepalived (>=2.0.14): https://github.com/acassen/keepalived/issues/1163 Story: 2005774 Task: 33491 Change-Id: Iaa34db6cb1dfed98e96a585c5d105e263c7efa65 --- .../backends/agent/api_server/keepalivedlvs.py | 7 +++++++ octavia/common/constants.py | 1 + .../fix-udp-server-status-bug-db4d3e38bcdf0554.yaml | 12 ++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 releasenotes/notes/fix-udp-server-status-bug-db4d3e38bcdf0554.yaml diff --git a/octavia/amphorae/backends/agent/api_server/keepalivedlvs.py b/octavia/amphorae/backends/agent/api_server/keepalivedlvs.py index bdf002e9c6..b3cee1d540 100644 --- a/octavia/amphorae/backends/agent/api_server/keepalivedlvs.py +++ b/octavia/amphorae/backends/agent/api_server/keepalivedlvs.py @@ -198,6 +198,13 @@ class KeepalivedLvs(udp_listener_base.UdpListenerApiServerBase): message='Invalid Request', details="Unknown action: {0}".format(action)), status=400) + # When octavia requests a reload of keepalived, force a restart since + # a keepalived reload doesn't restore members in their initial state. + # + # TODO(gthiemonge) remove this when keepalived>=2.0.14 is widely use + if action == consts.AMP_ACTION_RELOAD: + action = consts.AMP_ACTION_RESTART + self._check_udp_listener_exists(listener_id) if action == consts.AMP_ACTION_RELOAD: if consts.OFFLINE == self._check_udp_listener_status(listener_id): diff --git a/octavia/common/constants.py b/octavia/common/constants.py index 9a87474f4e..cd60c5c7d8 100644 --- a/octavia/common/constants.py +++ b/octavia/common/constants.py @@ -556,6 +556,7 @@ SYSCTL_CMD = '/sbin/sysctl' AMP_ACTION_START = 'start' AMP_ACTION_STOP = 'stop' AMP_ACTION_RELOAD = 'reload' +AMP_ACTION_RESTART = 'restart' GLANCE_IMAGE_ACTIVE = 'active' INIT_SYSTEMD = 'systemd' diff --git a/releasenotes/notes/fix-udp-server-status-bug-db4d3e38bcdf0554.yaml b/releasenotes/notes/fix-udp-server-status-bug-db4d3e38bcdf0554.yaml new file mode 100644 index 0000000000..c35f7d03e9 --- /dev/null +++ b/releasenotes/notes/fix-udp-server-status-bug-db4d3e38bcdf0554.yaml @@ -0,0 +1,12 @@ +--- +issues: + - | + When a load balancer with a UDP listener is updated, the listener service + is restarted, which causes an interruption of the flow of traffic during a + short period of time. This issue is caused by a keepalived bug + (https://github.com/acassen/keepalived/issues/1163) that was fixed in + keepalived 2.0.14, but this package is not yet provided by distributions. +fixes: + - | + Fix a bug that prevented UDP servers to be restored as members of a pool + after removing a health monitor resource.