MongoDB refuses a second DHCP custom option with the same tag on a scope or tag rule, and refuses to start on existing duplicates #312
No reviewers
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.
Dependencies
No dependencies set
Reference
lantea-one/ninlil!312
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/60-mongo-dhcp-option-unique"
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?
MongoDB now refuses a second DHCP custom option with the same tag on one scope or tag rule, and refuses to start when duplicates already exist (owner decision Q-BUG-6: refuse start, list them).
IndexSet.Uniquetakes several fields;NinlilDhcpScopeCustomOptions(ScopeId, OptionTag) andNinlilDhcpTagRuleOptions(TagRuleId, OptionTag) get unique indexes through a new step,MongoSchemaSteps.DhcpCustomOptionUniqueIndexes(appended last inKnown).DatabaseStartupRefusedException(exit 78) listing collection, owner, tag and document ids; nothing is deleted and the step is not recorded, so a cleaned database starts next time. A duplicate written between the scan and the build is caught (11000 on create) and listed the same way.MongoChangeTrackermaps a duplicate-key error (11000) toConflictException, which the controllers answer as 409, and logs the driver error (collection and index) at Warning. Nothing in the code catches the driver exceptions, so the mapping changes no handled path (verifier checked every caller; the other unique index isSecondaryZoneRefreshStates.ZoneId).Tests (
MongoDhcpCustomOptionUniquenessTests, MongoDB container): duplicate scope option and tag-rule option throw the conflict; seeded duplicates refuse the start with both listed and nothing deleted; the plain index becomes exactly one unique index; 6 concurrent runs over plain indexes succeed; a duplicate arriving after the scan is listed. The first four fail on develop. Integration Mongo 140, Data.Tests 124, Web.Tests 2081 (without Docker); build 0 warnings; csharpier clean.Closes #60
🤖 Generated with Claude Code
https://claude.ai/code/session_01T33E3pmQvqkTriyQUMNUTK