Zone and access-rule cache TTL backstop: instances that share one database see each other's zone and access-rule changes within 60 seconds #50
Labels
No labels
agent
api-regen
agent
architect
agent
coder
agent
console-coder
agent
docs-writer
agent
mechanic
agent
protocol-coder
agent
storage-coder
area/api
area/ci
area/console
area/dhcp
area/dns
area/docs
area/packaging
area/process
area/storage
area/windows
kind
bug
kind
chore
kind
docs
kind
epic
kind
feature
kind
performance
kind
security
kind
test
priority
high
priority
low
priority
medium
resolution
duplicate
resolution
not-a-bug
resolution
wontfix
status
blocked
status
in-progress
status
needs-decision
status
needs-design
status
ready
theme
ad-samba-dns
theme
alternatives-benchmark
theme
console-toolchain
theme
later
theme
parity-devices
theme
parity-query
theme
post-release-fixes
theme
tracker-setup
theme
valkey
theme
windows-installer
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Reference
lantea-one/ninlil#50
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
Every other DNS cache reloads by age (60 s for the client directory, filter configuration,
rewrites, schedules and forwarder zones; README.md:5092-5098). The zone, signed-zone and
access-rule caches reload only at startup and on a local event:
AuthoritativeZoneCache(src/dotnet/src/Ninlil.Dns.Server.Authoritative/Cache/AuthoritativeZoneCache.cs:31-68,142-181),reloaded by
ZoneChangedEventSubscriber(Cache/ZoneChangedEventSubscriber.cs:12-19).SignedZoneCache(Dnssec/SignedZoneCache.cs:69-73,150).DnsAccessControlRuleCache(src/dotnet/src/Ninlil.Dns.Server.AccessControl/DnsAccessControlRuleCache.cs:39-40,75-99).An instance ignores events made by another instance (README.md:4199-4204). So two instances on
one database never see each other's zone or access-rule changes. #71 adds instant cross-node
expiry through ValKey and keeps each cache's TTL as its backstop; this issue gives these three
caches that backstop.
What changes
ReloadAsync; the table is smalland flat, as the class summary says).
Ninlil.Dns.Server.Authoritative/Cache/runs every 60 s andonly detects changes:
AuthoritativeZoneCache.StartAsyncalready runs (:45-60).CachedZone: the zone row fields the caches use, andthe record set by id and content.
AuthoritativeZoneCachegets a read-only accessor forthis.
AuthoritativeZoneCache.ReloadZoneAsyncand
SignedZoneCache.ReloadZoneAsync, the pair the event subscribers use.Detection data is never written into a cache. A reload reads fresh from the primary, so a
local change made between the detection read and the reload is never undone. An unchanged
zone is not touched, so a signed zone is re-signed only when it changed.
CreateReplicaReadScope(the age-reload rule in AGENTS.md "Readreplicas"); the reload methods keep reading the primary. Update the comments at
AuthoritativeZoneCache.cs:33-35,144-146,SignedZoneCache.cs:71-73andDnsAccessControlRuleCache.cs:77-79, which say "never on a timer".DnsZoneChangedEventor start NOTIFY,PTR sync or webhooks; README.md:4199-4204 stays true.
TimeProviderso tests candrive it. No new option.
src/dotnet/benchmarks/Ninlil.Benchmarks/Dns/measures one detection passat Large (1,000 zones plus one of 50,000 records) on SQLite and PostgreSQL. Copy the numbers
into the PR.
shares the database show up after at most 60 seconds, plus the replica lag limit. #76 later
adds the ValKey bound to the same text.
Acceptance
AuthoritativeZoneCacheandSignedZoneCachepairs onone SQLite file; a record written straight through the repository (as another instance
would) is answered by the second cache after the fake time advances 61 s. An unchanged
signed zone is not signed again (count signing calls). A deleted zone disappears.
of fake time.
DnsZoneChangedEvent.dotnet test src/dotnet/tests/Ninlil.Dns.Server.Authoritative.Tests,src/dotnet/tests/Ninlil.Dns.Server.AccessControl.Testsandsrc/dotnet/tests/Ninlil.Web.Tests(DI wiring) pass.Source
INT.md #71 and Q-INT-5; README.md:4185-4204, 5086-5098; DEDUPE.md §2.
Owner decision 2026-10-31 (Q-INT-5): "60 s TTL backstop now, as a post-release-fixes issue".
Ghost referenced this issue2026-11-05 01:32:43 -05:00