Zones store aging settings and records store when a dynamic update last refreshed them #83

Open
opened 2026-10-31 12:42:03 -04:00 by claude · 0 comments
Owner
  • Draft: INT-14
  • Priority: medium
  • Agent: storage-coder
  • Depends on: #81 (sequenced to avoid migration clashes)
  • Decisions: Q-INT-6

Why

Records have no timestamp (RecordEntity.cs:19-79), so stale dynamic records are never removed. MS-DNSP defines the aging model: a per-zone no-refresh interval and refresh interval, and a per-record timestamp in which zero means static.

What changes

  • ZoneEntity gains AgingEnabled (default false), AgingNoRefreshInterval (default 7 days) and AgingRefreshInterval (default 7 days). Existing zones get the same defaults, so nothing is scavenged until an operator turns aging on.
  • RecordEntity gains DynamicRefreshedUtc (DateTimeOffset?, null = static, never scavenged). Store it as the repository stores other times (see *ConvertDhcpLeaseTimesToTicks.cs).
  • IRecordRepository.ListScavengeableAsync(zoneId, olderThanUtc, max) as a database-side query, with an index on (ZoneId, DynamicRefreshedUtc).
  • One migration per relational provider (AddRecordAging), MongoDB repository and index, a schema step if needed.

Acceptance

  • Integration tests, all engines: the null default; a new zone reads AgingEnabled = false with 7-day intervals; ListScavengeableAsync returns only non-null rows older than the cut-off, capped at max.
  • Four migrations exist.
  • src/dotnet/tests/Ninlil.Dns.Data.Integration.Tests passes.

Source

  • MS-DNSP (aging fields); owner scope (aging and scavenging). Also covers the aging bullet dropped from #251 (DEDUPE.md P1).
  • Owner decision 2026-10-31 (Q-INT-6): "off by default; 7 d + 7 d when on; on for AD-template zones".
- **Draft:** INT-14 - **Priority:** medium - **Agent:** storage-coder - **Depends on:** #81 (sequenced to avoid migration clashes) - **Decisions:** Q-INT-6 ### Why Records have no timestamp (`RecordEntity.cs:19-79`), so stale dynamic records are never removed. MS-DNSP defines the aging model: a per-zone no-refresh interval and refresh interval, and a per-record timestamp in which zero means static. ### What changes - `ZoneEntity` gains `AgingEnabled` (default false), `AgingNoRefreshInterval` (default 7 days) and `AgingRefreshInterval` (default 7 days). Existing zones get the same defaults, so nothing is scavenged until an operator turns aging on. - `RecordEntity` gains `DynamicRefreshedUtc` (DateTimeOffset?, null = static, never scavenged). Store it as the repository stores other times (see `*ConvertDhcpLeaseTimesToTicks.cs`). - `IRecordRepository.ListScavengeableAsync(zoneId, olderThanUtc, max)` as a database-side query, with an index on (ZoneId, DynamicRefreshedUtc). - One migration per relational provider (`AddRecordAging`), MongoDB repository and index, a schema step if needed. ### Acceptance - [ ] Integration tests, all engines: the null default; a new zone reads `AgingEnabled = false` with 7-day intervals; `ListScavengeableAsync` returns only non-null rows older than the cut-off, capped at `max`. - [ ] Four migrations exist. - [ ] `src/dotnet/tests/Ninlil.Dns.Data.Integration.Tests` passes. ### Source - MS-DNSP (aging fields); owner scope (aging and scavenging). Also covers the aging bullet dropped from #251 (DEDUPE.md P1). - Owner decision 2026-10-31 (Q-INT-6): "off by default; 7 d + 7 d when on; on for AD-template zones".
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#83
No description provided.