]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist-resolver: Fix a bug when we get new IPs for a server 16093/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 27 Jun 2025 14:09:18 +0000 (16:09 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 8 Sep 2025 09:00:51 +0000 (11:00 +0200)
commit57a15769b93bf9937c6bcca485f33fe04a31794b
tree0049f069fe98b1d14d28235ac6c6e058ed320edb
parent671952eb7caf0d5b176909bba16779f36dd1e59c
dnsdist-resolver: Fix a bug when we get new IPs for a server

The `dnsdist-resolver` script regularly checks the IPs corresponding
to a backend `hostname`, and updates our backend accordingly:
- if an IP we previously received vanishes, it removes the backend
  corresponding to that IP
- if a new IP shows up, it adds a new backend

The existing code tries to avoid some work by keeping track of the
number of IPs associated to a given server, skipping the comparisons
of recently received IPs to existing ones if the number did not change.
This unfortunately does not work well if we get the same number of IPs
but with different IPs in the set.
This caused some backends to never get removed and stay along as ghosts,
as well as some new IPs to never be picked up.

Signed-off-by: Remi Gacogne <remi.gacogne@powerdns.com>
(cherry picked from commit e306ec7a085282893b93214a75ba3aac4d9435b4)
dockerdata/dnsdist-resolver.lua