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

*: reduce raft cluster lock and replace some place with atomic #8786

Merged
merged 7 commits into from
Nov 18, 2024

Conversation

lhy1024
Copy link
Contributor

@lhy1024 lhy1024 commented Nov 7, 2024

What problem does this PR solve?

Issue Number: Close #8785

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 7, 2024
}

// GetStoreMinResolvedTS returns the min resolved ts of the store.
func (c *RaftCluster) GetStoreMinResolvedTS(storeID uint64) uint64 {
c.RLock()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not necessary

Copy link

codecov bot commented Nov 7, 2024

Codecov Report

Attention: Patch coverage is 85.18519% with 4 lines in your changes missing coverage. Please review.

Project coverage is 75.20%. Comparing base (40ae26c) to head (b466093).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8786      +/-   ##
==========================================
- Coverage   75.21%   75.20%   -0.01%     
==========================================
  Files         459      459              
  Lines       71843    71835       -8     
==========================================
- Hits        54035    54022      -13     
- Misses      14351    14366      +15     
+ Partials     3457     3447      -10     
Flag Coverage Δ
unittests 75.20% <85.18%> (-0.01%) ⬇️

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

Signed-off-by: lhy1024 <[email protected]>
Copy link
Member

@okJiang okJiang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use atomic.Value?

@lhy1024
Copy link
Contributor Author

lhy1024 commented Nov 8, 2024

Why not use atomic.Value?

Sure, at first I thought it was possible that we'd need to manually lock and unlock to control more of the code, but now it seems that atomic is sufficient for these three places

Signed-off-by: lhy1024 <[email protected]>
@ti-chi-bot ti-chi-bot bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 11, 2024
@lhy1024 lhy1024 changed the title *: split raft cluster lock and introduce locked value *: reduce raft cluster lock and replace some place with atomic Nov 11, 2024
@ti-chi-bot ti-chi-bot bot added the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label Nov 11, 2024
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
Signed-off-by: lhy1024 <[email protected]>
@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 Nov 11, 2024
@ti-chi-bot ti-chi-bot bot added the lgtm label Nov 18, 2024
Copy link
Contributor

ti-chi-bot bot commented Nov 18, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JmPotato, 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 /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 Nov 18, 2024
Copy link
Contributor

ti-chi-bot bot commented Nov 18, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-11-11 07:12:32.909174907 +0000 UTC m=+253915.100043897: ☑️ agreed by okJiang.
  • 2024-11-18 03:09:21.108125857 +0000 UTC m=+844123.298994847: ☑️ agreed by JmPotato.

@ti-chi-bot ti-chi-bot bot added the approved label Nov 18, 2024
@lhy1024
Copy link
Contributor Author

lhy1024 commented Nov 18, 2024

/test pull-integration-realcluster-test

@ti-chi-bot ti-chi-bot bot merged commit 1b4b21a into tikv:master Nov 18, 2024
25 checks passed
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 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.

*: split raft cluster lock
3 participants