-
Notifications
You must be signed in to change notification settings - Fork 721
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
*: decouple the dependency between server and mcs #5933
Conversation
Signed-off-by: lhy1024 <admin@liudos.us>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
return dummyServiceRegistry{} | ||
} | ||
|
||
type dummyServiceRegistry struct{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No longer need dummy
Codecov ReportBase: 75.22% // Head: 75.11% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #5933 +/- ##
==========================================
- Coverage 75.22% 75.11% -0.11%
==========================================
Files 362 362
Lines 36221 36232 +11
==========================================
- Hits 27247 27217 -30
- Misses 6600 6634 +34
- Partials 2374 2381 +7
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Signed-off-by: lhy1024 <admin@liudos.us>
pkg/mcs/registry/registry.go
Outdated
@@ -22,7 +21,7 @@ import ( | |||
"net/http" | |||
|
|||
"github.com/pingcap/log" | |||
"github.com/tikv/pd/server" | |||
bs "github.com/tikv/pd/pkg/basic_server" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bs "github.com/tikv/pd/pkg/basic_server" | |
bs "github.com/tikv/pd/pkg/basicserver" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about basicsvr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also think basicserver
is better than basicsvr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reverted invalid comment
@binshi-bing: Request changes is only allowed for the reviewers in list. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pr seems to split from #5858. Regarding this pr, I have the same ask in #5858 and pasted below:
@lhy1024 , thanks for spliting the common part (e.g., move APIServiceGroup from server to pkg/utils/apiutil, registry refactor) required by other services, from #5833 into this separate pr. They have higher priority than the remaining part in the original pr (mainly resource manager mcs related). Could you merge this one earlier so that we can both work on tso mcs and resource manager mcs more efficiently.
@binshi-bing: Thanks for your review. The bot only counts approvals from reviewers and higher roles in list, but you're still welcome to leave your comments. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
// GetMember returns the member information. | ||
GetMember() *member.Member | ||
// AddLeaderCallback adds a callback in the leader campaign phase. | ||
AddLeaderCallback(callbacks ...func(context.Context)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to put this API into basicserver.Server? This API means that this server will elect for leader, correct? It doesn't sound a must-havior behavior of a basic server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also consider to replace it with primary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add todo
In master branch, resource management is imported by install, which means it will always start however service mode. So we need to change it for tso mode. |
Signed-off-by: lhy1024 <admin@liudos.us> Conflicts: cmd/pd-server/main.go pkg/mcs/tso/server/server.go server/server.go
Signed-off-by: lhy1024 <admin@liudos.us> Conflicts: cmd/pd-server/main.go pkg/mcs/tso/server/server.go server/server.go
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
Please change the file back to 100644 |
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
pkg/mcs/registry/registry.go
Outdated
@@ -97,9 +97,3 @@ func (r *ServiceRegistry) InstallAllRESTHandler(srv *server.Server, h map[string | |||
func (r ServiceRegistry) RegisterService(name string, service ServiceBuilder) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about turn RegisterService func to pointer receivers
func (r *ServiceRegistry) RegisterService?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Signed-off-by: lhy1024 <admin@liudos.us>
server/testutil.go
Outdated
@@ -137,3 +140,21 @@ func MustWaitLeader(re *require.Assertions, svrs []*Server) *Server { | |||
}) | |||
return leader | |||
} | |||
|
|||
// CreateMokHandler creates a mock handler for test. | |||
func CreateMokHandler(re *require.Assertions, ip string) HandlerBuilder { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why it was called mok before, is mock written wrong?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server_test.go
and func CreateMokHandler
also has some legacy mok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ptal @lhy1024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
replace name in url
Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
/merge |
@disksing: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
This pull request has been accepted and is ready to merge. Commit hash: f526604
|
ref tikv#5837 Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 admin@liudos.us
What problem does this PR solve?
Issue Number: Ref #5837
What is changed and how does it work?
APIServiceGroup
toapiutil
server
withbasic_server
inmcs
init
ofmcs
in main.goCheck List
Tests
Release note