Skip to content
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

Merged
merged 6 commits into from
Dec 10, 2024

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Dec 9, 2024

What problem does this PR solve?

Issue Number: Close #8889 ref #8477

What is changed and how does it work?

Check List

Tests

  • Unit test

Release note

None.

@ti-chi-bot ti-chi-bot bot added release-note-none Denotes a PR that doesn't merit a release note. dco-signoff: yes Indicates the PR's author has signed the dco. needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 9, 2024
…part2)

Signed-off-by: lhy1024 <admin@liudos.us>
Signed-off-by: lhy1024 <admin@liudos.us>
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 {
Copy link
Contributor Author

@lhy1024 lhy1024 Dec 9, 2024

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.

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

Attention: Patch coverage is 95.45455% with 1 line in your changes missing coverage. Please review.

Project coverage is 76.12%. Comparing base (1e76110) to head (503e0ef).
Report is 1 commits behind head on master.

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     
Flag Coverage Δ
unittests 76.12% <95.45%> (-0.08%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Dec 9, 2024
@lhy1024
Copy link
Contributor Author

lhy1024 commented Dec 9, 2024

/test pull-integration-realcluster-test

1 similar comment
@lhy1024
Copy link
Contributor Author

lhy1024 commented Dec 9, 2024

/test pull-integration-realcluster-test

@rleungx
Copy link
Member

rleungx commented Dec 9, 2024

/retest

@rleungx
Copy link
Member

rleungx commented Dec 10, 2024

/test pull-integration-realcluster-test

3 similar comments
@lhy1024
Copy link
Contributor Author

lhy1024 commented Dec 10, 2024

/test pull-integration-realcluster-test

@lhy1024
Copy link
Contributor Author

lhy1024 commented Dec 10, 2024

/test pull-integration-realcluster-test

@rleungx
Copy link
Member

rleungx commented Dec 10, 2024

/test pull-integration-realcluster-test

Signed-off-by: lhy1024 <admin@liudos.us>
@ti-chi-bot ti-chi-bot bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Dec 10, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Dec 10, 2024
Copy link
Contributor

ti-chi-bot bot commented Dec 10, 2024

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Dec 10, 2024
Copy link
Contributor

ti-chi-bot bot commented Dec 10, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-12-09 12:03:47.973093368 +0000 UTC m=+267218.061895905: ☑️ agreed by rleungx.
  • 2024-12-10 07:51:52.225419718 +0000 UTC m=+338502.314222262: ☑️ agreed by okJiang.

@lhy1024
Copy link
Contributor Author

lhy1024 commented Dec 10, 2024

/test pull-integration-realcluster-test

Signed-off-by: lhy1024 <admin@liudos.us>
@ti-chi-bot ti-chi-bot bot merged commit 0b757ce into tikv:master Dec 10, 2024
25 checks passed
@lhy1024 lhy1024 deleted the fix-tso-job4 branch December 10, 2024 10:46
@lhy1024
Copy link
Contributor Author

lhy1024 commented Dec 10, 2024

/cherry-pick-release-8.5

@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #8890.

ti-chi-bot bot pushed a commit that referenced this pull request Dec 10, 2024
…part2) (#8885) (#8890)

ref #8477, close #8889

Signed-off-by: lhy1024 <admin@liudos.us>

Co-authored-by: lhy1024 <admin@liudos.us>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved dco-signoff: yes Indicates the PR's author has signed the dco. lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pd client panics with "[tso] timestamp fallback"
4 participants