]> git.ipfire.org Git - thirdparty/pdns.git/commit
dnsdist-resolver: Fix a bug when we get new IPs for a server 15737/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 27 Jun 2025 14:09:18 +0000 (16:09 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 27 Jun 2025 14:13:32 +0000 (16:13 +0200)
commite306ec7a085282893b93214a75ba3aac4d9435b4
tree990cfea2c6a87469e872c7c81daaedb8495dbdc1
parenta44ba546fcaac31496ce67dcbf580e1b5804d4e0
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>
dockerdata/dnsdist-resolver.lua