Repository navigation
New DNS not updating records #15000
Replies: 2 comments 2 replies
|
There is a configuration workaround worth testing while the zero-TTL handling is fixed: give the new resolver a small positive override, for example: The relevant setting is This is a mitigation, not correct handling of a DNS TTL of zero: it deliberately caches answers for the chosen interval, including answers that requested no caching. Pick an interval suitable for the resolver load and acceptable staleness in your environment. Don't use After applying the configuration, make sure the affected workers/caches are recreated, then test a DNS answer change to confirm the ALB addresses refresh. I checked this against the source, but have not reproduced your AWS setup. Reverting |
|
Confirmed on master today, and the consequence is worse than "not updating": a TTL of zero does not mean "cache briefly", it means "cache forever", and the record outlives the worker. The path is Zero is a sentinel in mlcache, in both layers. The L1 path is The legacy client does not hit this because it never hands a bare zero to a cache that reads zero as forever: it inserts with I could not find an issue or PR for this in the new client. For what it is worth, the same sentinel has bitten the library before: thibaultcha/lua-resty-mlcache#58, "Fix expiration when the remaining TTL is exactly 0". On the workaround you tried: For anyone arriving from a default install: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
The new DNS client pins a DNS record received with a TTL of 0, which can happen when querying a caching resolver.
RFC 8767 states:
We started getting 504s in API tests running in our AWS VPC after updating to 3.9.3 (current master) and setting
KONG_NEW_DNS_CLIENT = on. The reason was Kong not updating the ALB IPs associated with the DNS name. These can change for various reasons, and Kong was black-holing traffic to an IP that no longer existed. Similarly, it wasn't sending traffic to new IPs for that DNS name.The pin occurs because
kong/dns/client.luacomputes a TTL withttl = math_min(ttl, answer.ttl)and passes it to mlcache without checking for zero client.lua:309. Then:The old client doesn’t have this failure mode as it adds
staleTtland explicitly checkslru_ttl <= 0:All reactions