Add probing, announcing and conflict resolution (RFC 6762 §8-9)#271
Open
backkem wants to merge 4 commits into
Open
Add probing, announcing and conflict resolution (RFC 6762 §8-9)#271backkem wants to merge 4 commits into
backkem wants to merge 4 commits into
Conversation
c604b8b to
c1b926f
Compare
Member
Author
|
cc @JoTurk early feedback appreciated. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #271 +/- ##
==========================================
+ Coverage 82.05% 83.85% +1.79%
==========================================
Files 8 9 +1
Lines 1739 2285 +546
==========================================
+ Hits 1427 1916 +489
- Misses 203 244 +41
- Partials 109 125 +16
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
RFC 6762 §8-9 implementation: - probe.go: state machine (delay→probing→announcing→established) - Simultaneous probe tiebreaking with lexicographic compare (§8.2) - Conflict detection in all resource record sections (§9) - Rename strategy: "-N" for hosts, " (N)" for services - Rate limiting: 15 conflicts/10s → 5s backoff, 60s give-up - Cache-flush bit on unique records in announcements (§10.2) - WithProbing, WithConflictHandler options - WaitReady() blocks until initial probing completes - Conn.setConflictHandler/conflictHandler via atomic.Value
- Name inbound channel buffer size as constant - Test onProbeRenamed for host, service instance, escaped dots, case-insensitive match, and no-match no-op - Test WaitReady for nil probes, context cancellation, conn close - Test sequential conflicts (two rename cycles with record header verification) - Test full conflict-rename-announce cycle with wire content verification (renamed name, cache-flush bit, preserved rdata)
c1b926f to
161bfe1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
probe.go: State machine for name probing (delay→probing→announcing→established), simultaneous probe tiebreaking (§8.2), conflict detection across all RR sections (§9), rename + re-probe with rate limitingconfig.go:WithProbing(),WithConflictHandler()optionsconn.go:WaitReady(), atomic.Value conflict handler (unexported setter, ready to expose asOnConflictlater)server.go:probeManagerintegration,buildProbeSessions,onProbeRenamedcallbackprobe_test.go, deterministic via fake timers +sync.CondOpening as draft for early review feedback.
Open questions
probe.gois ~950 lines. Should we split it further, e.g.:probe.go— state machine + managerprobe_tiebreak.go—lexicographicCompare,sortResources,compareResource,packRDataprobe_rename.go—defaultRename,defaultRenameHost,defaultRenameServiceInstanceOr is one file fine given the tight coupling?
WaitReady(ctx) erroris currently exported onConn. Is this the right API surface, or should readiness be signaled differently (e.g. callback, channel field)?