Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
3 changes: 1 addition & 2 deletions integration-tests/scripts/manage-test-environment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,7 @@ pattern:
name: secondary
zonefile: "%s.secondary-zone"
allow-notify: 127.0.0.1 NOKEY
# Until Cascade supports IXFR we always use AXFR
request-xfr: AXFR 127.0.0.1@${_cascade_port} NOKEY
request-xfr: 127.0.0.1@${_cascade_port} NOKEY
provide-xfr: 127.0.0.1 NOKEY

zone:
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 @@ -166,6 +166,21 @@ jobs:
with:
log-level: ${{ inputs.log-level }}

ixfr-out:
name: Serve a zone via IXFR to the NSD secondary.
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/ixfr-out
with:
log-level: ${{ inputs.log-level }}

incremental-signing:
name: Test incremental signing.
runs-on: ubuntu-latest
Expand Down
183 changes: 183 additions & 0 deletions integration-tests/tests/ixfr-out/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@
# Making reusable composite actions documented at
# https://docs.github.com/en/actions/tutorials/create-actions/create-a-composite-action#creating-a-composite-action-within-the-same-repository
name: 'Serve a zone via IXFR to the NSD secondary.'
description: 'Serve a zone via IXFR to the NSD secondary.'
defaults:
# see: https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#defaultsrunshell
run:
shell: bash --noprofile --norc -eo pipefail -x {0}
inputs:
log-level:
description: The level of logging that Cascade should output.
required: false
default: debug
type: choice
options:
- error
- warning
- info
- debug
- trace
runs:
using: "composite"
steps:
- uses: ./.github/actions/prepare-systest-env
- uses: ./.github/actions/setup-and-start-cascade
with:
log-level: ${{ inputs.log-level }}

- name: Add a NOTIFY with TSIG outbound policy
run: |
POLICY_DIR=$(integration-tests/scripts/get-default-path.sh policy-dir)
cascade template policy | grep -Ev '(send-notify-to|accept-xfr-from)' > "${POLICY_DIR}/custom.toml"

sed -i -e 's/serial-policy = "date-counter"/serial-policy = "keep"/' "${POLICY_DIR}/custom.toml"
echo 'send-notify-to = ["127.0.0.1:1054"]' >> "${POLICY_DIR}/custom.toml"

# TODO: Extend the test to use TSIG (driven by inputs ala the tsig-downstream test)
# once PRs #564 and #587 have been merged.
# echo 'send-notify-to = ["127.0.0.1:1054^tsig-key"]' >> "${POLICY_DIR}/custom.toml"
# cascade tsig add tsig-key hmac-sha256 "COzoVsYQmXeXiyq1Quhp0bbVnMyxjPxsaGSoIWR98i0="
cascade policy reload
Comment thread
ximon18 marked this conversation as resolved.
Outdated

- name: Make an initial zone based on RFC 1995 section 7
run: |
tee example.test.zone <<'EOF'
EXAMPLE.TEST. IN SOA NS.EXAMPLE.TEST. mail.example.test. (
1 60 60 3600 5)
IN NS NS.EXAMPLE.TEST.
NS.EXAMPLE.TEST. IN A 133.69.136.1
NEZU.EXAMPLE.TEST. IN A 133.69.136.5
EOF

- name: Add the zone using the custom policy
run: |
cascade zone add --policy custom --source $PWD/example.test.zone example.test

- name: Check zone status
run: |
timeout=10 # seconds
start=$(date +%s)
until cascade zone status example.test | grep -q "Published zone available"; do
if (($(date +%s) > (start + timeout))); then
cascade zone status example.test
echo "timeout: zone status did not report published zone available" >&2
exit 1
fi
sleep 1
done

- name: Check the SOA SERIAL at the NSD secondary
run: |
timeout=10 # seconds
start=$(date +%s)
until dig +short @127.0.0.1 -p 1054 example.test SOA | grep -q 'ns.example.test. mail.example.test. 1 60 60 3600 5'; do
if (($(date +%s) > (start + timeout))); then
cascade zone status example.test
dig +short @127.0.0.1 -p 1054 example.test SOA
echo "::error:: timeout: NSD did not acquire the zone changes"
exit 1
fi
sleep 1
done

- name: Edit the source zone and tell Cascade to reload it.
run: |
tee example.test.zone <<'EOF'
example.test. IN SOA ns.example.test. mail.example.test. (
2 60 60 3600 5)
IN NS NS.EXAMPLE.TEST.
NS.EXAMPLE.TEST. IN A 133.69.136.1
JAIN-BB.EXAMPLE.TEST. IN A 133.69.136.4
IN A 192.41.197.2
EOF
cascade zone reload example.test

- name: Check zone status
run: |
timeout=10 # seconds
start=$(date +%s)
until cascade zone status example.test | grep -q "Published zone available"; do
if (($(date +%s) > (start + timeout))); then
cascade zone status example.test
echo "timeout: zone status did not report published zone available" >&2
exit 1
fi
sleep 1
done

- name: Check the SOA SERIAL at the NSD secondary
run: |
timeout=10 # seconds
start=$(date +%s)
until dig +short @127.0.0.1 -p 1054 example.test SOA | grep -q 'ns.example.test. mail.example.test. 2 60 60 3600 5'; do
if (($(date +%s) > (start + timeout))); then
cascade zone status example.test
dig +short @127.0.0.1 -p 1054 example.test SOA
echo "::error:: timeout: NSD did not acquire the zone changes"
exit 1
fi
sleep 1
done

- name: Edit the source zone and tell Cascade to reload it.
run: |
tee example.test.zone <<'EOF'
EXAMPLE.TEST. IN SOA ns.example.test. mail.example.test. (
3 60 60 3600 5)
IN NS NS.EXAMPLE.TEST.
NS.EXAMPLE.TEST. IN A 133.69.136.1
JAIN-BB.EXAMPLE.TEST. IN A 133.69.136.3
IN A 192.41.197.2
EOF
cascade zone reload example.test

- name: Check zone status
run: |
timeout=10 # seconds
start=$(date +%s)
until cascade zone status example.test | grep -q "Published zone available"; do
if (($(date +%s) > (start + timeout))); then
cascade zone status example.test
echo "timeout: zone status did not report published zone available" >&2
exit 1
fi
sleep 1
done

- name: Check the SOA SERIAL at the NSD secondary
run: |
timeout=10 # seconds
start=$(date +%s)
until dig +short @127.0.0.1 -p 1054 example.test SOA | grep -q 'ns.example.test. mail.example.test. 3 60 60 3600 5'; do
if (($(date +%s) > (start + timeout))); then
cascade zone status example.test
dig +short @127.0.0.1 -p 1054 example.test SOA
echo "::error:: timeout: NSD did not acquire the zone changes"
exit 1
fi
sleep 1
done

# Note: There is no NSD metric that I am aware of that we can use to
# verify that it received IXFR from Cascade instead of AXFR, nor is there
# any Cascade Prometheus metric or CLI command that we can use to check
# this either. Increasing the NSD log level to 9 doesn't cause it to
# report whether it received IXFR or AXFR either.

# TODO: Verify the AXFR and IXFR response content is as expected /
# matching that of NSD.

- run: dig +onesoa +noall +answer @127.0.0.1 -p 4542 example.test AXFR > cascade-axfr.log

- run: dig +onesoa +noall +answer @127.0.0.1 -p 4542 example.test -t IXFR=1 >cascade-ixfr-1.log

- run: dig +onesoa +noall +answer @127.0.0.1 -p 4542 example.test -t IXFR=2 >cascade-ixfr-2.log

- run: dig +onesoa +noall +answer @127.0.0.1 -p 4542 example.test -t IXFR=3 >cascade-ixfr-3.log

- run: dig +onesoa +noall +answer @127.0.0.1 -p 1054 example.test AXFR >nsd-axfr.log

- name: Print log files on any failure in this job
uses: ./.github/actions/print-logfiles
if: failure()
14 changes: 13 additions & 1 deletion src/persistence/persist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ pub fn persist_signed(
persister: SignedZonePersister,
) -> SignedZonePersisted {
// TODO
let _ = (zone, center);
let _ = center;

// Store the signed diff in-memory for serving IXFR.
// Only push a diff if a SOA was removed, otherwise this is not a diff to
// a previous version of the zone but actually the entire new zone content
// compared to an empty zone. Also don't store a diff to the same serial.
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();
state.storage.diffs.push(signed_diff.clone());
}

persister.mark_complete()
}
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