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

pkg: remove txn lock #6208

Merged
merged 2 commits into from Mar 23, 2023
Merged

pkg: remove txn lock #6208

merged 2 commits into from Mar 23, 2023

Conversation

rleungx
Copy link
Member

@rleungx rleungx commented Mar 22, 2023

What problem does this PR solve?

Issue Number: Ref #5895.

What is changed and how does it work?

The lock here is used for multiple callers using the same Txn. But we barely have this situation in PD. At least, we don't have a such scenario for now. So this PR is going to remove it to improve the TSO saving performance.

Check List

Tests

  • Unit test

Release note

None.

Signed-off-by: Ryan Leung <rleungx@gmail.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Mar 22, 2023

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • JmPotato
  • binshi-bing

To complete the pull request process, please ask the reviewers in the list to review by filling /cc @reviewer in the comment.
After your PR has acquired the required number of LGTMs, you can assign this pull request to the committer in the list by filling /assign @committer in the comment to help you merge this pull request.

The full list of commands accepted by this bot can be found here.

Reviewer can indicate their review by submitting an approval review.
Reviewer can cancel approval by submitting a request changes review.

@rleungx rleungx requested review from binshi-bing and JmPotato and removed request for disksing and Yisaer March 22, 2023 10:07
@codecov
Copy link

codecov bot commented Mar 22, 2023

Codecov Report

Patch coverage has no change and project coverage change: -0.06 ⚠️

Comparison is base (791106f) 74.85% compared to head (a70b2dd) 74.79%.

❗ Current head a70b2dd differs from pull request most recent head f304c58. Consider uploading reports for the commit f304c58 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6208      +/-   ##
==========================================
- Coverage   74.85%   74.79%   -0.06%     
==========================================
  Files         395      395              
  Lines       38714    38706       -8     
==========================================
- Hits        28980    28952      -28     
- Misses       7208     7222      +14     
- Partials     2526     2532       +6     
Flag Coverage Δ
unittests 74.79% <ø> (-0.06%) ⬇️

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

Impacted Files Coverage Δ
pkg/storage/kv/etcd_kv.go 79.50% <ø> (+1.81%) ⬆️

... and 23 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 22, 2023
Copy link
Contributor

@binshi-bing binshi-bing left a comment

Choose a reason for hiding this comment

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

It makes sense to me.

kv *etcdKVBase
ctx context.Context
// mu protects conditions and operations.
mu syncutil.Mutex
Copy link
Contributor

Choose a reason for hiding this comment

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

It seems that we just simply removed the lock. Does it mean we guarantee that no etcdTxn crosses multiple goroutines? It makes sense to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

For now, it is.

@ti-chi-bot ti-chi-bot added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 22, 2023
@rleungx
Copy link
Member Author

rleungx commented Mar 23, 2023

/merge

@ti-chi-bot
Copy link
Member

@rleungx: It seems you want to merge this PR, I will help you trigger all the tests:

/run-all-tests

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 ti-community-infra/tichi repository.

@ti-chi-bot
Copy link
Member

This pull request has been accepted and is ready to merge.

Commit hash: a70b2dd

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 23, 2023
@ti-chi-bot
Copy link
Member

@rleungx: Your PR was out of date, I have automatically updated it for you.

If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes.

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 ti-community-infra/tichi repository.

@ti-chi-bot ti-chi-bot merged commit 769de12 into tikv:master Mar 23, 2023
19 checks passed
@rleungx rleungx deleted the remove-lock1 branch March 23, 2023 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note-none status/can-merge Indicates a PR has been approved by a committer. status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants