Description of problem:
When keepalived is running inside a network namespace it could have no network access to the system configured name servers. So during a -HUP restart to reload new configuration keepalived tries to resolve it's own hostname twice, waiting for DNS timeout.
This makes keepalived MASTER move around the BACKUP instances.
The DNS resolutions are done to fill up default configuration regardless of configuration being set or not. So there is no way to avoid it without system workarounds.
This workaround fixes the issue, but could interfere with other services:
# echo 127.0.0.1 $( hostname ) >>/etc/hosts
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. set /etc/resolv.conf to a non responding DNS server.
when you kill -HUP $(keepalived_pid) the MASTER moves to a SLAVE because keepalived get's stuck in name resolution.
If you provide router_id and you're not configuring email notifications no DNS resolution should be invoked to fill up any of those default settings within keepalived.
Created attachment 1025539 [details]
Set global data default values after parsing config file
This patch will defer setting the global data default values until after the config file has been parsed. This will potentially avoid two calls to getaddrinfo. For example, if the router_id and/or email_from parameters are set in the config file, there is no need to call getaddrinfo twice in order to set a default value. Instead, this patch will check to see if they values are unset after parsing the config file. Note that email_from and smtp_connection_to are only set to a default value if they are unitialized and smtp_server is specified.
I'm planning to submit this upstream, but it might be worthwhile to have Neutron developers test this to make sure if fixes the problems. Note that in order to avoid all DNS queries you must have router_id set in global_defs, eg.
Upstream pull request:
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.