Repository navigation
bugfix: retry Raft discovery bootstrap after transient failures - #1239
Draft
yangjj-iso wants to merge 3 commits into
Draft
yangjj-iso wants to merge 3 commits into
yangjj-iso wants to merge 3 commits into
Conversation
Retry metadata acquisition when seed addresses are already cached but initial discovery failed. Serialize cold lookups and cover recovery from both a failed login and a failed metadata request. Generated-by: OpenAI Codex
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1239 +/- ##
==========================================
+ Coverage 65.31% 65.44% +0.12%
==========================================
Files 312 312
Lines 23890 23901 +11
==========================================
+ Hits 15604 15641 +37
+ Misses 6873 6856 -17
+ Partials 1413 1404 -9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
added 2 commits
December 1, 2026 14:44
Signed-off-by: redyyang <redyyang@tencent.com>
Signed-off-by: redyyang <redyyang@tencent.com>
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.
changes/dev.mdandchanges/dev_zh.md.What this PR does
A transient login or metadata request failure during Raft discovery can leave the seed addresses cached without cluster metadata. The next
Lookupthen returns an empty result without retrying the request. This can leave the client unable to discover a coordinator after the service recovers.This change retries metadata acquisition while cluster metadata is missing, reuses cached seed addresses, and starts periodic refresh after a successful fetch. Concurrent cold lookups wait for the bootstrap attempt and reuse the metadata it populates. Token reads and random endpoint selection are synchronized with periodic refresh.
Verification
TestRaftLookupRetriesBootstrapAfterFailurefail on unchangedmaster(bb5b982) and pass with this change. Each case simulates one HTTP 503, then checks that concurrent lookups return the coordinator after recovery.go test -race ./pkg/discovery -run '^TestRaftLookupRetriesBootstrapAfterFailure$' -count=100passed on Go 1.20.14 and 1.25.5.go test -race ./pkg/discovery/... -skip '^(TestWatch|TestSubscribeStartsWatchLoopPerVGroup)$' -count=1passed on Go 1.25.5. Both excluded NamingServer tests also fail on unchangedmasterin this environment.TestWatchcannot access netlink, andTestSubscribeStartsWatchLoopPerVGrouptimes out.go vet ./pkg/discovery/...,gofmt, andgit diff --checkpassed.OpenAI Codex generated the patch, regression tests, and this description and ran the local checks.