[PR #3155] [MERGED] Store validated responses in a separate cache #3601

Closed
opened 2026-03-16 11:52:36 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/3155
Author: @divergentdave
Created: 7/24/2025
Status: Merged
Merged: 7/25/2025
Merged by: @djc

Base: mainHead: david/recursor-split-cache


📝 Commits (1)

  • aca84dd Store validated responses in a separate cache

📊 Changes

2 files changed (+12 additions, -13 deletions)

View changed files

📝 crates/recursor/src/recursor.rs (+12 -8)
📝 crates/recursor/src/recursor_dns_handle.rs (+0 -5)

📄 Description

This changes the validating recursor to use separate response caches for responses received from authoritative servers and responses produced by <RecursorDnsHandle as DnsHandle>::send(). I think it's incorrect to commingle responses inserted there, which have been through a few forms of post-processing, with responses directly from authoritative servers. After this change, we only call insert() on each cache in one place.

This fixes a couple problems I ran into. First, the tests in #3154 for cached queries no longer show even more duplicate records versus the non-cached tests when I integrate these changes. We are still adding too many records, but each cache hit round trip no longer worsens the problem. Secondly, I was trying to fix #3125 by distinguishing between referral responses and authoritative responses, but got tripped up by entries inserted in <RecursorDnsHandle as DnsHandle>::send(). These responses have confusing values in their header flags. I'd like to be able to rely on AA there, so this change will make that bug fix easier.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/3155 **Author:** [@divergentdave](https://github.com/divergentdave) **Created:** 7/24/2025 **Status:** ✅ Merged **Merged:** 7/25/2025 **Merged by:** [@djc](https://github.com/djc) **Base:** `main` ← **Head:** `david/recursor-split-cache` --- ### 📝 Commits (1) - [`aca84dd`](https://github.com/hickory-dns/hickory-dns/commit/aca84dd04104bd5da94745c798b8149bf366d716) Store validated responses in a separate cache ### 📊 Changes **2 files changed** (+12 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/recursor/src/recursor.rs` (+12 -8) 📝 `crates/recursor/src/recursor_dns_handle.rs` (+0 -5) </details> ### 📄 Description This changes the validating recursor to use separate response caches for responses received from authoritative servers and responses produced by `<RecursorDnsHandle as DnsHandle>::send()`. I think it's incorrect to commingle responses inserted there, which have been through a few forms of post-processing, with responses directly from authoritative servers. After this change, we only call `insert()` on each cache in one place. This fixes a couple problems I ran into. First, the tests in #3154 for cached queries no longer show even more duplicate records versus the non-cached tests when I integrate these changes. We are still adding too many records, but each cache hit round trip no longer worsens the problem. Secondly, I was trying to fix #3125 by distinguishing between referral responses and authoritative responses, but got tripped up by entries inserted in `<RecursorDnsHandle as DnsHandle>::send()`. These responses have confusing values in their header flags. I'd like to be able to rely on AA there, so this change will make that bug fix easier. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:52:36 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#3601
No description provided.