Bug 1371948
Summary: | Deleting virtual machines with floating IPs causes qrouter interfaces to be deleted and recreated | |||
---|---|---|---|---|
Product: | Red Hat OpenStack | Reporter: | Robin Cernin <rcernin> | |
Component: | openstack-neutron | Assignee: | Ihar Hrachyshka <ihrachys> | |
Status: | CLOSED ERRATA | QA Contact: | GenadiC <gcheresh> | |
Severity: | urgent | Docs Contact: | ||
Priority: | urgent | |||
Version: | 8.0 (Liberty) | CC: | amuller, chrisw, cllewellyn, darryl, ihrachys, jschwarz, majopela, mlopes, nyechiel, oblaut, pneedle, rohara, smulholland, srelf, srevivo | |
Target Milestone: | --- | Keywords: | Triaged, ZStream | |
Target Release: | 8.0 (Liberty) | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | openstack-neutron-7.2.0-7.el7ost | Doc Type: | Bug Fix | |
Doc Text: |
Previously, the default L3 HA implementation (keepalived) sometimes flipped the master router instance to `backup` if it received multiple SIGHUP signals in quick succession. Consequently, L3 connectivity was disrupted until the previous backup keepalived instance took over.
With this update, to work around this keepalived behavior, the neutron L3 agent now throttles SIGHUP signals sent to keepalived to make sure keepalived has enough time to reload configuration without being disrupted by failovers.
As a result, L3 connectivity implemented using HA routers is not disrupted after router updates arriving in quick succession (for example, with floating IP updates).
|
Story Points: | --- | |
Clone Of: | ||||
: | 1398286 1436359 1436363 (view as bug list) | Environment: | ||
Last Closed: | 2017-06-20 12:56:17 UTC | Type: | Bug | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 1398286, 1436359, 1436363 |
Description
Robin Cernin
2016-08-31 13:47:37 UTC
Also this environment setup is [stack@undercloud ~]$ nova list +--------------------------------------+------------------------+--------+------------+-------------+---------------------+ | ID | Name | Status | Task State | Power State | Networks | +--------------------------------------+------------------------+--------+------------+-------------+---------------------+ | 2d9c97b8-dc5b-4c97-bb0f-50427c91ab90 | overcloud-compute-0 | ACTIVE | - | Running | ctlplane=192.0.2.7 | | 2a0f9a9d-983e-47b4-9127-b6152996b71e | overcloud-controller-0 | ACTIVE | - | Running | ctlplane=192.0.2.9 | | 60937186-a959-427f-b9eb-d7abcfca54c7 | overcloud-controller-1 | ACTIVE | - | Running | ctlplane=192.0.2.8 | | d2a6a304-bc20-4a44-b698-9bcea58172a7 | overcloud-controller-2 | ACTIVE | - | Running | ctlplane=192.0.2.10 | +--------------------------------------+------------------------+--------+------------+-------------+---------------------+ Router setup HA, no DVR here. The VMs were deleted through Horizon (so concurrently is a safe bet). Can we get the configuration files and the neutron logs for all neutron processes in all nodes, please? :) As an additional note to this it also occurs if you delete VMs with floating IPs sequentially within a short period via the API. Observations: 1. For some reason, when this occurs, the ha- interface loses its 169.254.0.1/24 for 4-5 seconds, and then it gets it back. l3 agent/openvswitch logs doesn't indicate either of them doing the actual deletion, so it's probably hidden somewhere in the code. 2. An easier reproduction can be to simply disassociate the floating IP from the instances. No need to delete the entire instance. 3. This seems to be occurring only when disassociating floating IPs from 2 more more instances - one is not enough. Also, when putting some kind of sleep between them, this doesn't reproduce. This hints at some race condition. 4. the state-change log indicates this also occurs when associating floating IPs, and not only on disassociation. The cause for Keepalived switching into backup (failing over) is because the specified actions (association and disassociation of floating ips) change the configuration of keepalived, and in addition sends SIGHUP to it. If 2 or more SIGHUPs are sent to keepalived in sequence, it will go into BACKUP (removing IP interfaces from the router's resources, which causes the connectivity loss) and restart VRRP negotiation. An approach we were thinking on Neutron's side is throttling SIGHUP to only send 1 every X seconds. Before we start working on this, it will be good to hear from Ryan if is there's any way to mitigate this on Keepalived's side? Also, it's important to note that manually sending SIGHUP to a keepalived process twice in a row also triggers this go-to-BACKUP state. (In reply to John Schwarz from comment #10) > The cause for Keepalived switching into backup (failing over) is because the > specified actions (association and disassociation of floating ips) change > the configuration of keepalived, and in addition sends SIGHUP to it. If 2 or > more SIGHUPs are sent to keepalived in sequence, it will go into BACKUP > (removing IP interfaces from the router's resources, which causes the > connectivity loss) and restart VRRP negotiation. What is changing in keepalived.conf when you do this? > An approach we were thinking on Neutron's side is throttling SIGHUP to only > send 1 every X seconds. Before we start working on this, it will be good to > hear from Ryan if is there's any way to mitigate this on Keepalived's side? First, I don't think throttling the frequency of SIGHUP is going to help in the long run. If keepalived is being signalled with SIGHUP multiple times in quick succession, the service is not going to be sending VRRP advertisements (since it is restarting), meaning another node will take over. Related question, does keepalived.conf have 'nopreempt' keyword declared? After much discussion and quite a bit o investigation, here is my assessment of how keepalived is behaving: First some background. The keepalived master node will periodically send VRRP advertisements, as configured by 'advert_int'. When a backup node does not receive a VRRP advertisement within this interval (plus some skew time), a failover occurs. Now, the other important detail is that the master keepalived node will no send VRRP advertisements while in a signal handler. When a keepalived node in the master state received a SIGHUP, it will block other signals while is processes the SIGHUP. While the SIGHUP signal handler is being executed, the VRRP advertisements stop. If just one signal is handled, chances are good that the node will complete the signal handler and resume sending VRRP advertisements before the backup node begin a new election. Conversely, if the signal handler takes too long the backup node(s) will not receive the advertisement on time and force a new master election. If multiple signals are received in quick succession, they are effectively queued and the signal handler will be executed once per signal, serially. This causes long(er) time where the master is not sending advertisements since it is busy (overwhelmed) handling signals. Note that short advertisement intervals and/or multiple SIGHUPs will increase the likelihood of triggering a failover in this manner. I've dug into this again. I noticed that in keepalived v1.2.20 this no longer happens (and in all versions up until then it does). The patch which (I believe) prevents this behaviour is https://github.com/acassen/keepalived/commit/6b20916a. It's important to note that I compiled and manually installed keepalived from sources to check this, as el7 only has 1.2.13. So the 'fix' (if this can be called a fix) is not available in rhel7 at all (yet?). Assaf, how do you want to proceed with this, given this new information? After looking more closely at the patch referenced in comment #14, I fail to see how this patch will address the issue. The patch will do two things: 1. If the priority is set to 255 and nopreempt is *not* set, the internal state variable will be tweaked. My understanding is that the Neutron L3 HA agent does use 'nopreempt' and the priority is not set to 255. Please correct me if I am wrong. 2. If nopreempt is set and the default state is set to MASTER, the code will print a warning. I believe you have state set to BACKUP, so you will not see this warning. I'm questioning if this patch will in fact fix the problem you're seeing. Verified in openstack-neutron-7.2.0-10.el7ost.noarch Created 5 VMs with floating IPs, Ping to one of them while removing all other VMs worked without interruption Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2017:1540 |