[GSOC] Add discovery provider registry and address store#1126
Open
CAICAIIs wants to merge 3 commits into
Open
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1126 +/- ##
==========================================
+ Coverage 58.36% 58.56% +0.19%
==========================================
Files 282 284 +2
Lines 19405 19486 +81
==========================================
+ Hits 11326 11412 +86
+ Misses 7102 7087 -15
- Partials 977 987 +10 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| registryService, err := provider(serviceConfig, registryConfig) | ||
| if err != nil { | ||
| panic(fmt.Errorf("init service registry err:%v", err)) | ||
| return err |
There was a problem hiding this comment.
这里失败时会保留旧的 registryServiceInstance。看上去是为了兼容旧 InitRegistry 的 panic 语义?但 InitRegistryWithError 作为新 API,最好再补个测试明确一下:已有 registry 后再初始化失败,GetRegistry 应该继续返回旧实例or变成 nil
|
basically, seems LGTM |
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.
What changed
This PR implements the PR1 discovery/registry groundwork from the GSoC plan.
InitRegistryWithErrorso init failures can be returned to callers.InitRegistrystill panics on error to keep the existing behavior.AddressStoreas the registry-owned snapshot store for service instances, keyed by cluster.AddressStorewhile keeping the existing key/value parsing and lookup behavior.Out of scope
This PR does not add Nacos, ZooKeeper, Consul, or Redis clients. It also leaves seata-ctl integration and SessionManager connection updates for later PRs.
Tests
go test ./pkg/discovery -run 'Test(File|Etcd|Init|AddressStore|RegistryProvider|Naming|Raft)'go test ./pkg/discoverygo test ./pkg/discovery -run TestAddressStoreConcurrentUpdateSnapshot -racegit diff --check