Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 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
f8890f7
Show TSIG key of source in output of CLI command zone status.
ximon18 Apr 30, 2026
52bd50d
Updated to match updated persist/restore framework.
ximon18 Apr 30, 2026
c613e24
Clippy.
ximon18 May 6, 2026
c4b91d5
Handle errors during restore of persisted zone data.
ximon18 May 6, 2026
0222445
Merge branch 'main' into persist-zones
ximon18 May 6, 2026
39b0b20
Save last serial and key tags in zone state.
Philip-NLnetLabs May 6, 2026
b18906e
Improvements to the persist-restore system test.
ximon18 May 6, 2026
6b8548b
Don't persist if nothing changed.
ximon18 May 6, 2026
fda163e
Account for a current known issue until it is resolved.
ximon18 May 6, 2026
5c3c6cf
Switch to apex_remove and apex_extra.
Philip-NLnetLabs May 6, 2026
ce23145
Fmt.
Philip-NLnetLabs May 6, 2026
e655ea1
More work on the persist-restore system test.
ximon18 May 6, 2026
cccdf75
Merge branch 'main' into persist-zones
ximon18 May 6, 2026
0887919
Merge branch 'full-signer-update-state' into persist-zones
ximon18 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
50d445b
Various updates.
ximon18 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
e730fad
Comment out code.
ximon18 May 9, 2026
825afd3
Merge branch 'main' into persist-zones
ximon18 May 9, 2026
2c52bcf
Restore both loaded and signed IXFR diff parts.
ximon18 May 9, 2026
a7888aa
Forget & remove persisted zone data if it cannot be loaded.
ximon18 May 10, 2026
aea51c6
Better progress reporting.
ximon18 May 10, 2026
45abfe9
FIX: Persist zone state last_published metadata.
ximon18 May 10, 2026
2fc7fac
Clippy.
ximon18 May 10, 2026
492efa1
Rename diffs -> diff_paths.
ximon18 May 11, 2026
db02b5f
Rename old_request -> request.
ximon18 May 11, 2026
d442640
Merge branch 'main' into persist-zones
ximon18 May 12, 2026
765d26f
Remove early merged versions of the ixfr-out test, these have since b…
ximon18 May 12, 2026
df39500
Merge fix.
ximon18 May 12, 2026
da67628
Remove change to system-tests that isn't needed by this PR.
ximon18 May 12, 2026
fabd541
Add back accidentally removed comment.
ximon18 May 12, 2026
97ed92b
Remove unnnecessary temporary diagnostic Debug derive.
ximon18 May 12, 2026
4f9d86d
Remove duplicate code resulting from merge.
ximon18 May 12, 2026
f9f4bfa
Remove reference to ixfr-out system test as that now has its own PR.
ximon18 May 12, 2026
e3406ef
Merge branch 'main' into persist-zones
ximon18 May 14, 2026
51e3747
Review feedback: restore instrumentation log level.
ximon18 May 14, 2026
2952b93
Note a possible structural improvement to be made later.
ximon18 May 14, 2026
90d1618
Review feedback: Don't reload disk zones on startup.
ximon18 May 22, 2026
d60fc06
Review feedback: Persist state now, and don't fail if prior persisted…
ximon18 May 22, 2026
aea5dd4
Correct English typo.
ximon18 May 22, 2026
4f73c85
Add some developer documentation about persistence and restore.
ximon18 May 22, 2026
dad097d
Move persist/restore docs to the right place.
ximon18 May 22, 2026
6edf773
Fix cargo-doc errors.
ximon18 May 22, 2026
8924fd3
Extend the persist-zone system test to restore from nothing.
ximon18 May 26, 2026
7935696
Remove errant whitespace.
ximon18 May 26, 2026
8142b35
On restore from nothing, abandon rather than finish restoration.
ximon18 May 26, 2026
5fb0578
Also test partial restoration of a previously signed zone.
ximon18 May 26, 2026
9b06567
On restore signed failure, switch to Passive state rather than the Si…
ximon18 May 26, 2026
e5adc5e
Fixes for restoring incremental signed diffs.
ximon18 May 26, 2026
e0ecbbb
Add an ASCII art state machine diagram for ZoneStorageData.
ximon18 May 27, 2026
3d03299
Remove a dupliate comment line.
ximon18 May 27, 2026
8714072
Minor typo correction.
ximon18 May 27, 2026
7d146a5
RustDoc updates.
ximon18 May 27, 2026
1186a5f
Minor comment reflowing and removal.
ximon18 May 27, 2026
7399096
Reflow comments, use consistent early abort style, and fix a bug.
ximon18 May 27, 2026
ccc891f
Merge branch 'main' into persist-zones
ximon18 May 27, 2026
836781f
Fix broken RustDoc links.
ximon18 May 27, 2026
8a7bca0
FIX: Don't overwrite the last in-memory IXFR diff with a new one crea…
ximon18 May 28, 2026
d595c3a
Clippy.
ximon18 May 28, 2026
1553374
Persist updated paths in state before writing to the new path, not th…
ximon18 May 28, 2026
9be63e1
Also log persistence complete.
ximon18 May 28, 2026
a017078
Review feedback: Remove unnecessary path canonicalization.
ximon18 May 28, 2026
d192b11
Review feedback: Remove commented out code.
ximon18 May 28, 2026
04ec7c2
Review feedback: Log error about correct path.
ximon18 May 28, 2026
b4b446d
Extract common code and fix unblocked re-signing on restore error.
ximon18 May 28, 2026
e48bd10
Clippy.
ximon18 May 28, 2026
af9d153
FIX: Abort any enqueud signing operations when restore failure discar…
ximon18 May 28, 2026
f680da0
Reflow comment.
ximon18 May 28, 2026
216e1f1
Minor comment improvement.
ximon18 May 28, 2026
c66b630
FIX: Also forget loaded diffs when aborting a restore.
ximon18 May 29, 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
1 change: 1 addition & 0 deletions crates/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ pub struct LastPublishedZone {
#[derive(Deserialize, Serialize, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)]
pub enum Progress {
Waiting,
Restoring,
Loading,
LoadedReview,
HaltLoaded,
Expand Down
11 changes: 7 additions & 4 deletions crates/cli/src/commands/zone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ impl Zone {
// Output information per step progressed until the first still
// in-progress/aborted step or show all steps if all have completed.
println!("");
print_status(zone.progress, &zone, &policy);
print_status(&zone, &policy);

if zone.last_published.is_some() {
println!("");
Expand Down Expand Up @@ -703,8 +703,11 @@ impl Zone {
}
}

pub fn print_status(current: Progress, zone: &ZoneStatus, policy: &PolicyInfo) {
let progress = match zone.progress {
pub fn print_status(zone: &ZoneStatus, policy: &PolicyInfo) {
let current = zone.progress;

let progress = match current {
Progress::Restoring => "restoring",
Progress::Waiting => "idle",
Progress::Loading => "loading",
Progress::LoadedReview => "waiting for loaded review",
Expand All @@ -717,7 +720,7 @@ pub fn print_status(current: Progress, zone: &ZoneStatus, policy: &PolicyInfo) {

println!("status: {}{progress}{}", ansi::BLUE, ansi::RESET);

if current == Progress::Waiting {
if matches!(current, Progress::Waiting | Progress::Restoring) {
return;
}

Expand Down
24 changes: 24 additions & 0 deletions crates/zonedata/src/restorer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,11 @@ impl LoadedZoneRestorer {
.find(|inst| inst.soa.is_some())
.map(LoadedZoneReader::new)
}

/// The diff from the preceding loaded instance to the current one.
pub fn take_diff(&mut self) -> Option<Box<DiffData>> {
self.diff.take()
}
}

impl LoadedZoneRestorer {
Expand Down Expand Up @@ -424,6 +429,20 @@ impl SignedZoneRestorer {
pub fn clear(&mut self) {
// Initialize the absolute data.

// SAFETY: As per the caller, 'loaded[index]' will not be
// accessed elsewhere for the lifetime of 'self', and so is sound to
// access mutably.
let next = unsafe { &mut *self.data.loaded[self.index as usize].get() };
next.soa = None;
next.records.clear();

// SAFETY: As per the caller, 'loaded[!index]' will not be
// accessed elsewhere for the lifetime of 'self', and so is sound to
// access mutably.
let curr = unsafe { &mut *self.data.loaded[!self.index as usize].get() };
curr.soa = None;
curr.records.clear();

// SAFETY: As per the caller, 'signed[index]' will not be
// accessed elsewhere for the lifetime of 'self', and so is sound to
// access mutably.
Expand Down Expand Up @@ -469,6 +488,11 @@ impl SignedZoneRestorer {
.find(|inst| inst.soa.is_some())
.map(|inst| SignedZoneReader::new(curr_loaded, inst))
}

/// The diff from the preceding signed instance to the current one.
pub fn take_diff(&mut self) -> Option<Box<DiffData>> {
self.diff.take()
}
}

impl SignedZoneRestorer {
Expand Down
26 changes: 26 additions & 0 deletions crates/zonedata/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,32 @@ mod transitions;
/// reviewed, and switched to. While it requires `&mut` access to be modified,
/// it is designed to live in a (synchronous) mutex -- expensive operations on
/// the zone are always achievable without `&mut` access.
///
/// ```text
/// ╔═══════════════════╗ finish ╔═══════════════════╗ finish
/// ║ RestoringLoaded ╠═════════▶ RestoringSigned ╠════════╗
/// ╚══╤════════════════╝ ╚══╤════════════════╝ ║
/// │ abandon │ abandon ║
/// ┌──▼─────────────────────────────▼─────────────────────────▼─────────┐
/// │ Passive │
/// └─────────╥────────────────────────────────────────────────────────▲─┘
/// ║ │ mark_complete
/// ┌─────────║──────────────────────────────────────────────────────────┐ ╔═════════════╗ start ╔════════════════════╗ approve
/// │ ║ Cleaning <═══════════════║ Switching <═══════════║ PersistingSigned <═══════════════════════════════════════════════════════════════════▲
/// └─────────║──────▲─────────────────────────────────────────────────▲─┘ ╚═════════════╝ ╚════════════════════╝ ║
/// ║ │ │ stop_review ║
/// ║ │ ┌─────────────────────┐ stop_review ┌────────────────────┐ give_up ║
/// load ║ │ give_up │ CleanLoadedPending <──────────────────────────│ CleanWholePending <─────────────────────────────────────────────────────┐ ║
/// ║ │ └────▲────────────────┘ └────────────────────┘ │ ║
/// ▼ │ │ give_up │ ║
/// ╔═════════╧═╗ finish ╔══════════════════════════╗ start ╔═══════════════════╗ approve ╔════════════════════╗ complete ╔══▼═════════════╗ finish ╔═══════════════════════╗ start ╔══════════════════╗
/// ║ Loading ╠════════▶ ReviewingLoadedPending ╠═══════▶ ReviewingLoaded ╠═════════▶ PersistingLoaded ╠══════════▶ Signing ╠════════▶ ReviewSignedPending ╠═══════▶ ReviewingSigned ║
/// ╚═══════════╝ ╚══════════════════════════╝ ╚═══════════════════╝ ╚════════════════════╝ ╚══╤═════════▲═══╝ ╚═══════════════════════╝ ╚════════╤═════════╝
/// retry │ │ complete retry │
/// ┌──▼─────────┴────┐ stop_review ┌──────────▼──────────┐
/// │ CleaningSigned <─────────────────────────────────────│ CleanSignedPending │
/// └─────────────────┘ └─────────────────────┘
/// ```
pub enum ZoneDataStorage {
/// The loaded instance of the zone is being restored.
RestoringLoaded(RestoringLoadedStorage),
Expand Down
15 changes: 5 additions & 10 deletions crates/zonedata/src/storage/transitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,20 +138,19 @@ impl RestoringSignedStorage {
LoadedZoneReviewer,
SignedZoneReviewer,
ZoneViewer,
SignedZoneBuilder,
SigningStorage,
PassiveStorage,
) {
assert!(
Arc::ptr_eq(restorer.data(), &self.data),
"'restorer' is for a different zone"
);

restorer.clear();

let Self {
data,
curr_loaded_index,
curr_loaded_index: _,
} = self;
let curr_loaded_index = false;
let curr_signed_index = false;

let loaded_reviewer =
Expand All @@ -166,18 +165,14 @@ impl RestoringSignedStorage {
)
};
let viewer = unsafe { ZoneViewer::new(data.clone(), curr_loaded_index, curr_signed_index) };
let builder = unsafe {
SignedZoneBuilder::new(data.clone(), curr_loaded_index, !curr_signed_index, None)
};

let storage = SigningStorage {
let storage = PassiveStorage {
data,
curr_loaded_index,
curr_signed_index,
loaded_diff: None,
};

(loaded_reviewer, signed_reviewer, viewer, builder, storage)
(loaded_reviewer, signed_reviewer, viewer, storage)
}
}

Expand Down
15 changes: 15 additions & 0 deletions integration-tests/system-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -301,3 +301,18 @@ jobs:
accept-xfr-from: ${{ matrix.accept-xfr-from }}
downstream-expects-tsig: ${{ matrix.downstream-expects-tsig }}
downstream-uses-tsig: ${{ matrix.downstream-uses-tsig }}

persist-zone:
name: Added zone should still exist after restart.
runs-on: ubuntu-latest
strategy:
matrix:
rust: [stable]
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/set-build-profile
with:
build-profile: ${{ inputs.build-profile }}
- uses: ./integration-tests/tests/persist-zone
with:
log-level: ${{ inputs.log-level }}
Loading
Loading