Config reload without restart

143 views
Skip to first unread message

Konstantin Shcherban

unread,
Feb 11, 2015, 10:55:21 AM2/11/15
to gd...@googlegroups.com
Hello,

Is there any way to reload gdnsd config without restart?

Jim Popovitch

unread,
Feb 11, 2015, 10:59:48 AM2/11/15
to gdnsd on behalf of Konstantin Shcherban
On Wed, Feb 11, 2015 at 10:55 AM, Konstantin Shcherban via gdnsd
<gdnsd+APn2wQeqhJroO0qn_NrqppHyf_...@googlegroups.com>
wrote:
> Hello,
>
> Is there any way to reload gdnsd config without restart?

gdnsd reload-zones

Despite the name, it also reloads config changes (or at least does so in v2.2)

-Jim P.

Brandon Black

unread,
Feb 11, 2015, 1:54:58 PM2/11/15
to gdnsd on behalf of Jim Popovitch
On Wed Feb 11 2015 at 9:59:49 AM gdnsd on behalf of Jim Popovitch <gd...@googlegroups.com> wrote:
On Wed, Feb 11, 2015 at 10:55 AM, Konstantin Shcherban via gdnsd

wrote:
> Hello,
>
> Is there any way to reload gdnsd config without restart?

gdnsd reload-zones

Despite the name, it also reloads config changes (or at least does so in v2.2)

Really? It shouldn't be possible; there's no code in the current gdnsd capable of reloading the config at runtime, so a full restart should be necessary.

Full restarts are relatively inexpensive, though.  Some pains are taken to overlap the startup delay of the new daemon while the old continues to run, but it's not yet perfect (some buffered requests can be lost during a brief window) and it doesn't work if running as a systemd service.

I have a local branch I've been working on sporadically over the past few months which will implement a "reload" verb that (from the outside point of view) reloads the entire config without any requests lost, and works correctly regardless of running under systemd or not.

Internally it's implemented as a full restart via execve() with some tight communication between the old and new instances, and the sockets are handed off from the old to the new with overlap (for those listening sockets common to both the old and new config).  This also means reload can be used to upgrade the running version of the installed binary seamlessly as well (assuming I don't manage to break compatibility...).

There would still be a separate "restart" mechanism that works much like the current one: more chance of a few lost buffered packets, but it's much simpler and more robust restarting mechanism, in case the more complicated "reload" mechanism gets its compatibility broken in a version upgrade, or has bugs.

It wasn't ready in time for 2.2, but hopefully it will be the primary feature in the 2.3 release.

-- Brandon

Jim Popovitch

unread,
Feb 11, 2015, 2:05:47 PM2/11/15
to gdnsd on behalf of blblack
On Wed, Feb 11, 2015 at 1:54 PM, gdnsd on behalf of blblack
<gd...@googlegroups.com> wrote:
> On Wed Feb 11 2015 at 9:59:49 AM gdnsd on behalf of Jim Popovitch
> <gd...@googlegroups.com> wrote:
>>
>> On Wed, Feb 11, 2015 at 10:55 AM, Konstantin Shcherban via gdnsd
>>
>> <gdnsd+APn2wQeqhJroO0qn_NrqppHyf_...@googlegroups.com>
>> wrote:
>> > Hello,
>> >
>> > Is there any way to reload gdnsd config without restart?
>>
>> gdnsd reload-zones
>>
>> Despite the name, it also reloads config changes (or at least does so in
>> v2.2)
>
>
> Really?

No. :-( I had added an IP address to the maps config, then ran
'gdnsd reload-zones' and then used gdnsd_geoip_test that the IP
address was indeed now pointing at a new datacenter. But now I see
that gdnsd_geoip_test just parses the config file so I was wrong
earlier.

-Jim P.

Konstantin Shcherban

unread,
Feb 12, 2015, 5:22:30 AM2/12/15
to gd...@googlegroups.com
Thank you for clarification.
Currently we are using 1.11.4 gdnsd for high load projects and it's config has lots of pools which we frequently change.
I have noticed that sometimes restart just shuts down gdnsd without starting it, however config syntax is ok. So manual start required to get it work again.

Waiting for new release with config reload feature.

среда, 11 февраля 2015 г., 21:54:58 UTC+3 пользователь blblack написал:
Reply all
Reply to author
Forward
0 new messages