Dynamic updates refresh record timestamps and a scavenging pass removes records not refreshed in time #84

Open
opened 2026-10-31 12:42:03 -04:00 by claude · 0 comments
Owner
  • Draft: INT-15
  • Priority: medium
  • Agent: coder
  • Depends on: #83, #82
  • Decisions: Q-INT-6

Why

AD clients refresh their records every day or so. Records of machines that are gone stay forever.

What changes

  • DynamicUpdateQueryResolver, DynamicUpdateProcessor and IZoneUpdateService:
    • A record added by an update gets DynamicRefreshedUtc = now.
    • An update that re-adds an identical record is a no-op for the zone today (ComputeDiff finds no change). It now sets the timestamp, unless the record is still inside the no-refresh interval.
    • A timestamp-only change does not bump the SOA serial and raises no DnsZoneChangedEvent, because answers do not change.
    • Records with ManagedByFeature set and records created through REST stay null.
  • New DnsScavengingService (BackgroundService) in Ninlil.Dns.Server.Authoritative:
    • Runs every ScavengingInterval.
    • For each zone with aging on, it deletes records whose timestamp is older than no-refresh plus refresh, in batches, through IZoneUpdateService. The serial bumps once per batch.
    • Owner rows of names left empty are removed.
  • Options: DnsServer:Scavenging with Enable and Interval. Add it to OptionsEnvironmentVariableRegistry and ENVIRONMENT.md. The service runs by default; zones decide through AgingEnabled, which is off unless set (or created by the AD template).
  • ZoneModels.cs gets the aging fields. RecordModels exposes dynamicRefreshedUtc read-only, plus POST /api/zones/{id}/scavenge (permission zones:write). The REST API changes; regeneration is #86.

Acceptance

  • Unit test (fails first), with a fake TimeProvider: an update at t0 sets the timestamp; a repeat at t0 + 1 h (inside no-refresh) leaves it; a repeat at t0 + no-refresh + 1 h moves it.
  • A scavenging pass at t0 + no-refresh + refresh + 1 h deletes the record and bumps the serial once. A static record in the same zone stays.
  • A zone with aging off is never scavenged.
  • src/dotnet/tests/Ninlil.Dns.Server.Authoritative.Tests passes.
  • src/dotnet/tests/Ninlil.Web.Tests passes for the endpoint and its permission.
  • README and ENVIRONMENT.md updated.

Source

  • MS-DNSP (aging and scavenging semantics); owner scope.
  • Owner decision 2026-10-31 (Q-INT-6): "off by default; 7 d + 7 d when on".
- **Draft:** INT-15 - **Priority:** medium - **Agent:** coder - **Depends on:** #83, #82 - **Decisions:** Q-INT-6 ### Why AD clients refresh their records every day or so. Records of machines that are gone stay forever. ### What changes - `DynamicUpdateQueryResolver`, `DynamicUpdateProcessor` and `IZoneUpdateService`: - A record added by an update gets `DynamicRefreshedUtc = now`. - An update that re-adds an identical record is a no-op for the zone today (`ComputeDiff` finds no change). It now sets the timestamp, unless the record is still inside the no-refresh interval. - A timestamp-only change does not bump the SOA serial and raises no `DnsZoneChangedEvent`, because answers do not change. - Records with `ManagedByFeature` set and records created through REST stay null. - New `DnsScavengingService` (BackgroundService) in `Ninlil.Dns.Server.Authoritative`: - Runs every `ScavengingInterval`. - For each zone with aging on, it deletes records whose timestamp is older than no-refresh plus refresh, in batches, through `IZoneUpdateService`. The serial bumps once per batch. - Owner rows of names left empty are removed. - Options: `DnsServer:Scavenging` with `Enable` and `Interval`. Add it to `OptionsEnvironmentVariableRegistry` and `ENVIRONMENT.md`. The service runs by default; zones decide through `AgingEnabled`, which is off unless set (or created by the AD template). - `ZoneModels.cs` gets the aging fields. `RecordModels` exposes `dynamicRefreshedUtc` read-only, plus `POST /api/zones/{id}/scavenge` (permission `zones:write`). The REST API changes; regeneration is #86. ### Acceptance - [ ] Unit test (fails first), with a fake `TimeProvider`: an update at t0 sets the timestamp; a repeat at t0 + 1 h (inside no-refresh) leaves it; a repeat at t0 + no-refresh + 1 h moves it. - [ ] A scavenging pass at t0 + no-refresh + refresh + 1 h deletes the record and bumps the serial once. A static record in the same zone stays. - [ ] A zone with aging off is never scavenged. - [ ] `src/dotnet/tests/Ninlil.Dns.Server.Authoritative.Tests` passes. - [ ] `src/dotnet/tests/Ninlil.Web.Tests` passes for the endpoint and its permission. - [ ] README and `ENVIRONMENT.md` updated. ### Source - MS-DNSP (aging and scavenging semantics); owner scope. - Owner decision 2026-10-31 (Q-INT-6): "off by default; 7 d + 7 d when on".
Sign in to join this conversation.
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.

Reference
lantea-one/ninlil#84
No description provided.