-
Notifications
You must be signed in to change notification settings - Fork 725
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
cluster: fix tso fallback due raft cluster did not stop tso service (part2) #8885
Conversation
…part2) Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
server/cluster/cluster.go
Outdated
defer func() { | ||
// We need to try to stop tso jobs when the cluster is not running. | ||
// Ref: https://github.com/tikv/pd/issues/8836 | ||
if !c.running { |
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 think it is better to check running
rather than error. Firstly, we need to call stopTSOJobsIfNeeded
whenever we return early, regardless of whether error is nil or not. Secondly, it prevents us from modifying the code later to return the error without assigning a value to it.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8885 +/- ##
==========================================
- Coverage 76.20% 76.12% -0.08%
==========================================
Files 461 461
Lines 70431 70448 +17
==========================================
- Hits 53669 53626 -43
- Misses 13407 13452 +45
- Partials 3355 3370 +15
Flags with carried forward coverage won't be shown. Click here to find out more. |
/test pull-integration-realcluster-test |
1 similar comment
/test pull-integration-realcluster-test |
/retest |
/test pull-integration-realcluster-test |
3 similar comments
/test pull-integration-realcluster-test |
/test pull-integration-realcluster-test |
/test pull-integration-realcluster-test |
Signed-off-by: lhy1024 <admin@liudos.us>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: okJiang, rleungx 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 |
/test pull-integration-realcluster-test |
Signed-off-by: lhy1024 <admin@liudos.us>
/cherry-pick-release-8.5 |
In response to a cherrypick label: new pull request created to branch |
What problem does this PR solve?
Issue Number: Close #8889 ref #8477
What is changed and how does it work?
Check List
Tests
Release note