Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2c1f606
Add limited initial IXFR out support (AXFR fallback only) and a minim…
ximon18 Apr 28, 2026
5dd79aa
PoC IXFR-out.
ximon18 Apr 28, 2026
fd6c2f3
Merge branch 'main' into ixfr-out
ximon18 Apr 30, 2026
9421203
Clippy.
ximon18 Apr 30, 2026
5345a2b
De-clutter ixfr-out system test output.
ximon18 Apr 30, 2026
39b0b20
Save last serial and key tags in zone state.
Philip-NLnetLabs May 6, 2026
5c3c6cf
Switch to apex_remove and apex_extra.
Philip-NLnetLabs May 6, 2026
ce23145
Fmt.
Philip-NLnetLabs May 6, 2026
3987494
Merge branch 'main' into ixfr-out
ximon18 May 7, 2026
538cc28
Review feedback: Remove outdated TODO comment.
ximon18 May 7, 2026
ddfdc2e
Review feedback: Better log message.
ximon18 May 7, 2026
941bf19
Review feedback: Remove unnecessary braces.
ximon18 May 7, 2026
92da4ff
Review feedback: Log at wrong level.
ximon18 May 7, 2026
54de825
Review feedback: Errant period in comment.
ximon18 May 7, 2026
a7120d2
Review feedback: Added some fn RustDocs.
ximon18 May 7, 2026
87ff6a7
Extend IXFR-out system test to use TSIG too.
ximon18 May 7, 2026
c2d1a7b
FIX: system-test should pass the `with-tsig` input correctly to the i…
ximon18 May 8, 2026
cd989d1
(WIP) Extend the ixfr-out test to actually verify produced output.
ximon18 May 8, 2026
c733215
Add more logging of request handling w.r.t. ACL processing.
ximon18 May 8, 2026
4e48270
FIX: include loaded RRs in the IXFR out, not just signed RRs.
ximon18 May 8, 2026
570415c
Review feedback.
Philip-NLnetLabs May 8, 2026
f0f9ebb
Merge branch 'main' into ixfr-out
ximon18 May 8, 2026
d399f1d
Adjust test condition.
ximon18 May 8, 2026
cfd91be
Review feedback: signal upgrade to TCP on UDP IXFR request.
ximon18 May 8, 2026
01fac00
Review feedback: Duplicate spawn comment.
ximon18 May 8, 2026
7905990
Review feedback: Note the potential to use flat_map() to avoid a vec …
ximon18 May 8, 2026
02efdfc
Review feedback: Remove irrelevant comment.
ximon18 May 8, 2026
baf4c64
Verify more XFR outputs against expectations.
ximon18 May 8, 2026
8f95fd4
Review feedback: Move IXFR diff logging from TRACE to DEBUG level.
ximon18 May 11, 2026
3781eae
FIX: Also store signed-only diffs.
ximon18 May 11, 2026
8b52b2b
Ignore NOTIFY if the zone was sourced from a file.
ximon18 May 11, 2026
35b8d5b
Serve diffs from the loaded reviewer server too.
ximon18 May 11, 2026
4ed1029
Merge loaded-review and signed-review IXFR out RR selection code.
ximon18 May 11, 2026
8312b8b
Remove unnecessary Options.
ximon18 May 11, 2026
c877ffc
Add an incremental signing based IXFR-out system test.
ximon18 May 11, 2026
d2ec91f
Merge branch 'main' into ixfr-out
ximon18 May 12, 2026
06d4bf0
Add IXFR out review server tests, and fix a bug that was found.
ximon18 May 12, 2026
393fb4d
Typo correction.
ximon18 May 12, 2026
0c692c6
Remove system tests, they will be moved to a separate PR.
ximon18 May 12, 2026
394b534
Review feedback: Return SERVFAIL instead of NOTAUTH for empty zone.
ximon18 May 12, 2026
1a3885b
Merge branch 'main' into ixfr-out
ximon18 May 12, 2026
1f47a28
Really remove the system tests.
ximon18 May 12, 2026
cb936e5
Remove change related to now removed system tests.
ximon18 May 12, 2026
7195745
I can't type...
ximon18 May 12, 2026
6f5f566
Review feedback: remove unnecessary step / temporary variable.
ximon18 May 12, 2026
10b717d
Enforce ACLs only on the publication server. (fixes #648)
ximon18 May 12, 2026
7bdc3ee
Query the transient diff at review servers. (fixes #652)
ximon18 May 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion crates/zonedata/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@

use std::sync::Arc;

use crate::{LoadedZoneRestorer, LoadedZoneReviewer, SignedZoneReviewer, ZoneViewer, data::Data};
use crate::{
DiffData, LoadedZoneRestorer, LoadedZoneReviewer, SignedZoneReviewer, ZoneViewer, data::Data,
};

mod states;
pub use states::{
Expand Down Expand Up @@ -135,4 +137,27 @@ impl ZoneDataStorage {
ZoneDataStorage::Poisoned => "Poisoned",
}
}

/// Get the current loaded diff, if any.
pub fn loaded_diff(&self) -> Option<Arc<DiffData>> {
match self {
ZoneDataStorage::ReviewLoadedPending(s) => Some(s.loaded_diff.clone()),
ZoneDataStorage::ReviewingLoaded(s) => Some(s.loaded_diff.clone()),
ZoneDataStorage::PersistingLoaded(s) => Some(s.loaded_diff.clone()),
_ => None,
}
}

/// Get the current signed diff, if any.
pub fn signed_diff(&self) -> Option<Arc<DiffData>> {
match self {
ZoneDataStorage::ReviewSignedPending(s) => Some(s.signed_diff.clone()),
ZoneDataStorage::ReviewingSigned(s) => Some(s.signed_diff.clone()),
ZoneDataStorage::PersistingSigned(_) => {
// PersistingSigned has no diff unlike PersistingLoaded
None
}
_ => None,
}
}
}
61 changes: 56 additions & 5 deletions src/persistence/persist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::sync::Arc;

use cascade_zonedata::{
LoadedZonePersisted, LoadedZonePersister, SignedZonePersisted, SignedZonePersister,
DiffData, LoadedZonePersisted, LoadedZonePersister, SignedZonePersisted, SignedZonePersister,
};

use crate::{center::Center, zone::Zone};
Expand All @@ -19,8 +19,30 @@ pub fn persist_loaded(
center: &Arc<Center>,
persister: LoadedZonePersister,
) -> LoadedZonePersisted {
// TODO
let _ = (zone, center);
let _ = center;

// Store the loaded diff in-memory for serving IXFR out.

let loaded_diff = persister.loaded_diff();

// Only store a diff if something has changed compared to the previous
// version of the loaded zone, otherwise this is not a diff to a previous
// version of the zone but actually a snapshot of the zone after having
// been loaded for the first time. If the SOA serial didn't change (which
// is legal for a loaded zone) don't store a diff because the IXFR protocol
// requires a SOA serial number change so we won't be able to serve the diff
// anyway.
if !loaded_diff.is_empty() && loaded_diff.removed_soa.is_some() {
// Store anything that changed when the zone was re-loaded, i.e.
// unsigned zone content changes. Note that the SOA SERIAL is not
// required to change unless using 'keep' policy and so we should not
// require the SOA to have been removed and a new one added.
let mut state = zone.state.lock().unwrap();

let loaded_only_diff = (persister.loaded_diff().clone(), DiffData::new().into());
state.storage.diffs.push(loaded_only_diff);
}

persister.mark_complete()
}

Expand All @@ -35,7 +57,36 @@ pub fn persist_signed(
center: &Arc<Center>,
persister: SignedZonePersister,
) -> SignedZonePersisted {
// TODO
let _ = (zone, center);
let _ = center;

// Store the signed diff in-memory for serving IXFR out.
//
// Only store a diff if the SOA from the previous version of the signed
// zone was removed and a new one added, otherwise this is not a diff to a
// previous version of the zone but actually a snapshot of the zone after
// having been signed for the first time.
let loaded_diff = persister.loaded_diff();
let signed_diff = persister.signed_diff();

if signed_diff.removed_soa.is_some() && signed_diff.removed_soa != signed_diff.added_soa {
let mut state = zone.state.lock().unwrap();

// Store anything that changed when the zone was re-loaded, i.e.
// unsigned zone content changes. Note that the SOA SERIAL is not
// required to change unless using 'keep' policy and so we should not
// require the SOA to have been removed and a new one added.

// Store anything that changed when the zone was re-signed, i.e.
// changes DNSSEC RRs that can be caused by unsigned content changes
// or changing from NSEC <-> NSEC3 or using a new key to sign with or
// just regenerating signatures to avoid them expiring. Signed zones
// MUST always have a new SOA SERIAL compared to the previous version
// of the signed zone.

let loaded_diff = loaded_diff.cloned().unwrap_or(DiffData::new().into());
let complete_diff = (loaded_diff, signed_diff.clone());
state.storage.diffs.push(complete_diff);
}

persister.mark_complete()
}
6 changes: 3 additions & 3 deletions src/server/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub struct LoadedReviewServer {
impl LoadedReviewServer {
/// Construct a new [`LoadedReviewServer`].
pub fn new() -> Self {
let (service, handle) = ZoneService::new();
let (service, handle) = ZoneService::new(service::ServiceMode::LoadedReview);
Self { service, handle }
}

Expand Down Expand Up @@ -123,7 +123,7 @@ pub struct SignedReviewServer {
impl SignedReviewServer {
/// Construct a new [`SignedReviewServer`].
pub fn new() -> Self {
let (service, handle) = ZoneService::new();
let (service, handle) = ZoneService::new(service::ServiceMode::SignedReview);
Self { service, handle }
}

Expand Down Expand Up @@ -212,7 +212,7 @@ pub struct PublicationServer {
impl PublicationServer {
/// Construct a new [`PublicationServer`].
pub fn new() -> Self {
let (service, handle) = ZoneService::new();
let (service, handle) = ZoneService::new(service::ServiceMode::Publication);
Self { service, handle }
}

Expand Down
1 change: 0 additions & 1 deletion src/server/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ pub enum ZoneRequestKind {
Axfr,

/// An IXFR request.
#[expect(dead_code)]
Ixfr {
/// The SOA record known to the client.
known_soa: Record<(), Soa<Box<Name>>>,
Expand Down
Loading
Loading