Merged
Conversation
Contributor
Author
|
@tgreenx, @marc-vanderwal, @mattias-p and @MichaelTimbert: now the global chache return without saving to cache when TTL==0. |
marc-vanderwal
previously approved these changes
Nov 7, 2024
tgreenx
previously approved these changes
Nov 7, 2024
there is no TTL from the DNS packet (e.g. SERVFAIL).
Contributor
Author
|
@marc-vanderwal and @tgreenx, please review. |
tgreenx
reviewed
Nov 12, 2024
Co-authored-by: tgreenx <96772376+tgreenx@users.noreply.github.com>
Contributor
Author
|
@marc-vanderwal and @tgreenx, please re-review. |
tgreenx
approved these changes
Nov 12, 2024
marc-vanderwal
approved these changes
Nov 12, 2024
mattias-p
approved these changes
Nov 12, 2024
Contributor
|
Release testing v2024.2: no issues found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Purpose
This PR does three things about global (Redis) cache:
Caching time and default for that
A DNS response can be of three type (when it comes to caching):
For response type 1 the extracted TTL value was used, but limited to cache.redis.expire (default 300 seconds, but much higher is needed to get full effect). For type 2 and 3 cache.redis.expire was used.
With this PR the logic for response type 1 is kept as it. For responses of type 2 and 3 a fixed value of 1200 seconds is used. The plan is to create a new profile element for type 2 and 3 to make that caching time settable.
Context
Global cache was introduced in release v2023.2 and has shown no issues. With this PR together with zonemaster/zonemaster#1303 it will become stable.
Fixes #1338
How to test this PR
--nsthat points at something outside that does not respond on port 53.redis-cli KEYS '*',redis-cli TTL KEYandredis-cli flushallfor key in $( redis-cli KEYS '*' | cut -f2 ) ; do redis-cli TTL $key ; done