[PR #3228] [CLOSED] Introduce trait for storage backing authoritative zones #3658

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

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/3228
Author: @divergentdave
Created: 8/26/2025
Status: Closed

Base: mainHead: david/authoritative-zone-storage-trait


📝 Commits (4)

📊 Changes

25 files changed (+3054 additions, -3256 deletions)

View changed files

📝 bin/src/lib.rs (+22 -16)
📝 bin/tests/integration/in_memory.rs (+2 -2)
📝 bin/tests/integration/store_file_tests.rs (+20 -10)
📝 bin/tests/integration/store_sqlite_tests.rs (+19 -10)
📝 bin/tests/integration/txt_tests.rs (+11 -39)
crates/server/src/store/authoritative.rs (+1411 -0)
📝 crates/server/src/store/file.rs (+104 -229)
crates/server/src/store/in_memory/inner.rs (+0 -869)
📝 crates/server/src/store/in_memory/mod.rs (+84 -780)
📝 crates/server/src/store/metrics.rs (+12 -11)
📝 crates/server/src/store/mod.rs (+896 -0)
📝 crates/server/src/store/sqlite/mod.rs (+187 -1116)
📝 tests/integration-tests/src/example_authority.rs (+112 -64)
📝 tests/integration-tests/tests/integration/catalog_tests.rs (+34 -21)
📝 tests/integration-tests/tests/integration/client_future_tests.rs (+6 -9)
📝 tests/integration-tests/tests/integration/client_tests.rs (+3 -6)
📝 tests/integration-tests/tests/integration/dnssec_client_handle_tests.rs (+2 -2)
📝 tests/integration-tests/tests/integration/invalid_nsec3_tests.rs (+8 -4)
📝 tests/integration-tests/tests/integration/invalid_nsec_tests.rs (+8 -4)
📝 tests/integration-tests/tests/integration/lookup_tests.rs (+8 -6)

...and 5 more files

📄 Description

This PR splits the authoritative zone authorities into two parts, a common AuthoritativeAuthority and an implementation of the new StoreBackend trait. This is part of #3169.

I had to make some small changes to the code as I moved it around, in order to reflect the new split between structs. I also had to replace an SqliteAuthority::update_records() call with an StoreBackendExt::upsert() during SQLite setup, because it crossed an abstraction boundary the wrong way, but I think the behavior is the same in this context. Note that some test expectations for response codes related to AxfrPolicy::Deny changed, because differing AXFR logic was unified.

While this will unblock a variety of other improvements, I want to get this big refactor landed separately. The trait as it is does not meaningfully encapsulate either the SQLite database or the in-memory data structure, but both can be improved in the future now that we have the beginning of an API boundary. Naming could use some work, as well as the internal arrangement of modules, but those will be easy to change separately.


🔄 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/3228 **Author:** [@divergentdave](https://github.com/divergentdave) **Created:** 8/26/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `david/authoritative-zone-storage-trait` --- ### 📝 Commits (4) - [`11dd690`](https://github.com/hickory-dns/hickory-dns/commit/11dd6909cac25ece1d38dfb2306cbb8dc2ecd0fb) Add StoreBackend trait - [`ffe377e`](https://github.com/hickory-dns/hickory-dns/commit/ffe377ec4e66160cfb2651d98a316f62ac03ffa2) Split up InMemoryAuthority - [`d529976`](https://github.com/hickory-dns/hickory-dns/commit/d529976723d3d9e3750d9ffa1787cc239e0a8ff0) Split up FileAuthority - [`74f04fa`](https://github.com/hickory-dns/hickory-dns/commit/74f04fa8d65730e983d3c526d37bdbf9ccf866e8) Split up SqliteAuthority ### 📊 Changes **25 files changed** (+3054 additions, -3256 deletions) <details> <summary>View changed files</summary> 📝 `bin/src/lib.rs` (+22 -16) 📝 `bin/tests/integration/in_memory.rs` (+2 -2) 📝 `bin/tests/integration/store_file_tests.rs` (+20 -10) 📝 `bin/tests/integration/store_sqlite_tests.rs` (+19 -10) 📝 `bin/tests/integration/txt_tests.rs` (+11 -39) ➕ `crates/server/src/store/authoritative.rs` (+1411 -0) 📝 `crates/server/src/store/file.rs` (+104 -229) ➖ `crates/server/src/store/in_memory/inner.rs` (+0 -869) 📝 `crates/server/src/store/in_memory/mod.rs` (+84 -780) 📝 `crates/server/src/store/metrics.rs` (+12 -11) 📝 `crates/server/src/store/mod.rs` (+896 -0) 📝 `crates/server/src/store/sqlite/mod.rs` (+187 -1116) 📝 `tests/integration-tests/src/example_authority.rs` (+112 -64) 📝 `tests/integration-tests/tests/integration/catalog_tests.rs` (+34 -21) 📝 `tests/integration-tests/tests/integration/client_future_tests.rs` (+6 -9) 📝 `tests/integration-tests/tests/integration/client_tests.rs` (+3 -6) 📝 `tests/integration-tests/tests/integration/dnssec_client_handle_tests.rs` (+2 -2) 📝 `tests/integration-tests/tests/integration/invalid_nsec3_tests.rs` (+8 -4) 📝 `tests/integration-tests/tests/integration/invalid_nsec_tests.rs` (+8 -4) 📝 `tests/integration-tests/tests/integration/lookup_tests.rs` (+8 -6) _...and 5 more files_ </details> ### 📄 Description This PR splits the authoritative zone authorities into two parts, a common `AuthoritativeAuthority` and an implementation of the new `StoreBackend` trait. This is part of #3169. I had to make some small changes to the code as I moved it around, in order to reflect the new split between structs. I also had to replace an `SqliteAuthority::update_records()` call with an `StoreBackendExt::upsert()` during SQLite setup, because it crossed an abstraction boundary the wrong way, but I think the behavior is the same in this context. Note that some test expectations for response codes related to `AxfrPolicy::Deny` changed, because differing AXFR logic was unified. While this will unblock a variety of other improvements, I want to get this big refactor landed separately. The trait as it is does not meaningfully encapsulate either the SQLite database or the in-memory data structure, but both can be improved in the future now that we have the beginning of an API boundary. Naming could use some work, as well as the internal arrangement of modules, but those will be easy to change separately. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 11:55: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#3658
No description provided.