-
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
*: move tso to independent thread #8720
Conversation
client/client.go
Outdated
@@ -203,7 +203,9 @@ func (k *serviceModeKeeper) close() { | |||
defer k.Unlock() | |||
switch k.serviceMode { | |||
case pdpb.ServiceMode_API_SVC_MODE: | |||
k.tsoSvcDiscovery.Close() | |||
if k.tsoSvcDiscovery != nil { |
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.
What about moving this check into Close()
?
server/cluster/cluster.go
Outdated
@@ -390,25 +400,85 @@ func (c *RaftCluster) checkServices() { | |||
} | |||
} | |||
|
|||
// checkTSOService checks the TSO service. | |||
func (c *RaftCluster) checkTSOService() { | |||
if !c.isAPIServiceMode { |
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.
if !c.isAPIServiceMode { | |
if c.isAPIServiceMode { | |
return | |
} |
server/cluster/cluster.go
Outdated
if !c.isAPIServiceMode { | ||
if c.member.IsLeader() { | ||
if err := c.startTSOJobs(); err != nil { | ||
// If there is an error, need to wait for the next check. |
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 log here?
server/cluster/cluster.go
Outdated
} else { | ||
// leader exits, reset the allocator group | ||
if err := c.stopTSOJobs(); err != nil { | ||
// If there is an error, need to wait for the next check. |
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.
/retest |
@@ -314,11 +322,13 @@ func (c *RaftCluster) Start(s Server) error { | |||
if err != nil { | |||
return err | |||
} | |||
c.checkTSOService() |
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.
Can we put this func next to checkSchedulingService
?
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.
prefer to check it ASAP
@@ -1715,29 +1714,6 @@ func (s *Server) campaignLeader() { | |||
s.member.KeepLeader(ctx) | |||
log.Info(fmt.Sprintf("campaign %s leader ok", s.mode), zap.String("campaign-leader-name", s.Name())) | |||
|
|||
if !s.IsAPIServiceMode() { |
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.
Need we remove the comments? L1714, L1703-L1706
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 still works
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.
rest lgtm
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]>
Signed-off-by: Ryan Leung <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8720 +/- ##
==========================================
- Coverage 69.97% 69.94% -0.04%
==========================================
Files 517 517
Lines 79953 79983 +30
==========================================
- Hits 55947 55941 -6
- Misses 20429 20472 +43
+ Partials 3577 3570 -7
Flags with carried forward coverage won't be shown. Click here to find out more. |
/retest |
Signed-off-by: Ryan Leung <[email protected]>
/hold |
Signed-off-by: Ryan Leung <[email protected]>
/hold cancel |
Signed-off-by: Ryan Leung <[email protected]>
@@ -390,25 +400,76 @@ func (c *RaftCluster) checkServices() { | |||
} | |||
} | |||
|
|||
// checkTSOService checks the TSO service. | |||
func (c *RaftCluster) checkTSOService() { |
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.
Seems we do not need this wrap function now. We can call startTSOJobs
directly.
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.
for the upcomming PR
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nolouch, 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 |
@rleungx: The following test failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
What problem does this PR solve?
Issue Number: Ref #8477.
What is changed and how does it work?
This is a part of #8517.
Check List
Tests
Release note