-
Notifications
You must be signed in to change notification settings - Fork 720
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
mcs: remove wait api service ready #8476
Conversation
return s.startServer() | ||
} | ||
|
||
func (s *Server) Register() error { |
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.
these Register
are similar, could we merge them?
@@ -103,21 +105,49 @@ func (s *Server) SetLogLevel(level string) error { | |||
|
|||
// Run runs the Resource Manager server. | |||
func (s *Server) Run() (err error) { | |||
skipWaitAPIServiceReady := false |
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.
Will removing affect serverless? I am not sure either.
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.
InitClusterID now will retry until the etcd can provide the service.
5e9905d
to
4cb4135
Compare
9940598
to
08ac9e7
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #8476 +/- ##
========================================
Coverage 77.40% 77.41%
========================================
Files 472 472
Lines 61821 61515 -306
========================================
- Hits 47854 47620 -234
+ Misses 10400 10360 -40
+ Partials 3567 3535 -32 |
@@ -34,7 +34,7 @@ import ( | |||
"github.com/tikv/pd/pkg/cache" | |||
"github.com/tikv/pd/pkg/core/constant" | |||
"github.com/tikv/pd/pkg/core/storelimit" | |||
"github.com/tikv/pd/pkg/mcs/utils" | |||
mcsconstat "github.com/tikv/pd/pkg/mcs/utils/constant" |
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.
mcsconstat "github.com/tikv/pd/pkg/mcs/utils/constant" | |
mcsconstant "github.com/tikv/pd/pkg/mcs/utils/constant" |
@@ -113,9 +113,7 @@ func (suite *serverRegisterTestSuite) checkServerRegister(serviceName string) { | |||
} | |||
|
|||
func (suite *serverRegisterTestSuite) TestServerPrimaryChange() { | |||
suite.checkServerPrimaryChange(utils.TSOServiceName, 3) | |||
// TODO: uncomment after resource-manager is ready |
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.
remove this comment?
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.
yes
return clusterID, nil | ||
} | ||
select { | ||
case <-ctx.Done(): | ||
return 0, err | ||
case <-ticker.C: | ||
retryTimes++ |
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.
It will print the log every 250s until it succeeds?
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.
same as previous
} | ||
if err := utils.InitClient(s); err != nil { | ||
|
||
// register |
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 is a meaningless comment. We can remove it
pkg/mcs/scheduling/server/server.go
Outdated
} | ||
|
||
if err := utils.InitClient(s); err != nil { | ||
// register |
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.
ditto
pkg/mcs/server/server.go
Outdated
@@ -100,6 +100,11 @@ func (bs *BaseServer) SetETCDClient(etcdClient *clientv3.Client) { | |||
bs.etcdClient = etcdClient | |||
} | |||
|
|||
// SetETCDClient sets the etcd client. |
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.
typo
// SetETCDClient sets the etcd client. | |
// GetETCDClient gets the etcd client. |
pkg/mcs/tso/server/server.go
Outdated
return err | ||
} | ||
|
||
// register |
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.
ditto
@@ -330,6 +278,41 @@ func StopGRPCServer(s server) { | |||
} | |||
} | |||
|
|||
func Register(s server, serviceName string) (uint64, *discovery.ServiceRegistryEntry, *discovery.ServiceRegister, error) { |
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.
Please add some comments for it
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.
Most of the content in the file is related to the server
. Maybe we can rename the file, or later move the server-related parts to server.go
.
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.
Please fix the conflict
d3c700b
to
fa0e332
Compare
/cc @niubell |
@rleungx: GitHub didn't allow me to request PR reviews from the following users: niubell. Note that only tikv members and repo collaborators can review this PR, and authors cannot review their own PRs. 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 kubernetes/test-infra repository. |
209129b
to
e63eb93
Compare
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
Signed-off-by: Ryan Leung <[email protected]>
e63eb93
to
059b18e
Compare
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: JmPotato, lhy1024, niubell, okJiang The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What problem does this PR solve?
Issue Number: ref #8477
What is changed and how does it work?
To support dynamically switching TSO, we must utilize the service discovery to decide who is responsible for serving TSO requests. However, the current implementation will register the TSO service until the API server is ready to serve. So there must be at least one switch when we use ms mode to start the cluster.
Check List
Tests
Release note