Repository navigation
resolved: add new option to only cache positive answers - #13047
Merged
Merged
Conversation
1 of 2 tasks
poettering
requested changes
Jul 16, 2019
poettering
left a comment
Member
There was a problem hiding this comment.
Looks conceptually grace. Two nitpicks
Contributor
Author
|
@poettering Thank you for your review. I've amended your observations, Thanks. |
keszybz
requested changes
Jul 17, 2019
keszybz
left a comment
Member
There was a problem hiding this comment.
Looks nice, but the docs need one more round.
poettering
reviewed
Jul 17, 2019
poettering
reviewed
Jul 17, 2019
niedbalski
force-pushed
the
fix-5552-pr
branch
3 times, most recently
from
July 17, 2019 14:31
f34c236 to
cbf43f8
Compare
Change the resolved.conf Cache option to a tri-state "no, no-negative, yes" values. If a lookup returns SERVFAIL systemd-resolved will cache the result for 30s (See 201d995), however, there are several use cases on which this condition is not acceptable (See systemd#5552 comments) and the only workaround would be to disable cache entirely or flush it , which isn't optimal. This change adds the 'no-negative' option when set it avoids putting in cache negative answers but still works the same heuristics for positive answers. Signed-off-by: Jorge Niedbalski <[email protected]>
Contributor
Author
|
@keszybz @poettering Thank you for your review and time spent on this. I've amended the requested changes and observations and It's ready for your review. |
Member
|
LGTM. |
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.
Hello maintainers,
This is a proposal patch to change the resolved.conf Cache option to a tri-state "no, no-negative, yes" values.
If a lookup returns SERVFAIL systemd-resolved will cache the result for 30s (See 201d995),
however, there are several use cases on which this condition is not acceptable (See #5552 comments)
and the only workaround would be to disable cache entirely or flush it , which isn't optimal.
This change adds the 'no-negative' option which when set avoids putting in cache
negative answers but still works the same heuristics for positive answers.
Tests Performed
With this patch applied, No behaves by ignoring all cache types, Yes caches the positive/negative answers and the new option 'no-negative' avoids to cache negative answers.
root@systemd-disco:/home/ubuntu# host www.metaklass.org
Host www.metaklass.org not found: 2(SERVFAIL)
root@systemd-disco:/home/ubuntu# journalctl -u systemd-resolved -n
-- Logs begin at Fri 2019-07-12 18:09:42 UTC, end at Fri 2019-07-12 18:48:31 UTC. --
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Cache miss for www.metaklass.org IN A
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Transaction 22382 for <www.metaklass.org IN A> scope dns on ens3/.
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Using feature level UDP for transaction 22382.
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Sending query packet with id 22382.
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Processing incoming packet on transaction 22382 (rcode=SERVFAIL).
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Server returned error: SERVFAIL
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Not caching negative entry for: www.metaklass.org IN A, cache mode set to no-negative
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Transaction 22382 for <www.metaklass.org IN A> on scope dns on ens3/ now complete with from network (unsigned).
Jul 12 18:48:31 systemd-disco systemd-resolved[2635]: Sending response packet with id 31060 on interface 1/AF_INET.
See #5552