Lease storage counts active leases per scope in the database #115
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#115
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
ILeaseRepositorycan count all leases or one scope's leases (src/dotnet/src/Ninlil.Dhcp.Data.Abstractions/Repository/ILeaseRepository.cs:117,:143), and can list active leases (:90), but cannot count active leases for every scope in one query. The writer samples this every minute, so it must not load rows.What changes
ILeaseRepository.CountActiveByScopeAsync(DateTimeOffset nowUtc, CancellationToken stoppingToken)returningIReadOnlyList<ActiveLeaseCount>(ScopeName,ProtocolVersion,Count). If #58 (leases refer to their scope by id) has landed, returnScopeIdinstead ofScopeName.DhcpScopeStatisticsService.IsBlockinguses with stateActive: not expired atnowUtc, or no expiry (DhcpScopeStatisticsService.cs:50-52,:101-103).GROUP BYin EF; one aggregation pipeline in MongoDB.src/dotnet/benchmarks/Ninlil.Benchmarks/Dhcp/at Large, on every engine.Acceptance
src/dotnet/tests/Ninlil.Dns.Data.Integration.Tests: scope A with 2 active and 1 expired lease, and scope B with 1 active lease, return counts 2 and 1. Every engine (SQLite without Docker, the restRequiresDocker).Source
Owner decision 2026-10-31 (Q-PQ-12): "leases over time".