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

kv: added RunInTransaction style transaction interface #5347

Merged
merged 12 commits into from Jan 10, 2023

Conversation

AmoebaProtozoa
Copy link
Contributor

@AmoebaProtozoa AmoebaProtozoa commented Jul 22, 2022

What problem does this PR solve?

Issue Number: Ref #5293

Current kv.Base interface lacks the ability to run batch commands in transactions.
In order to leverage transactions in etcd, one must get a hold of etcd.Client, bypassing the Storage and KV level abstractions.

This PR aims to solve this by providing basic transaction abilities at the storage level.

What is changed and how does it work?

Check List

Tests

  • Unit test

Release note

None.

Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
@ti-chi-bot
Copy link
Member

ti-chi-bot commented Jul 22, 2022

[REVIEW NOTIFICATION]

This pull request has been approved by:

  • disksing
  • rleungx

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.

@ti-chi-bot ti-chi-bot added do-not-merge/needs-linked-issue do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note-none labels Jul 22, 2022
@AmoebaProtozoa AmoebaProtozoa mentioned this pull request Jul 22, 2022
11 tasks
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
@AmoebaProtozoa AmoebaProtozoa changed the title [WIP] kv: added RunInTransaction style transaction interface kv: added RunInTransaction style transaction interface Jul 27, 2022
@codecov
Copy link

codecov bot commented Jul 27, 2022

Codecov Report

Base: 75.45% // Head: 75.34% // Decreases project coverage by -0.11% ⚠️

Coverage data is based on head (bf1de5b) compared to base (275c43e).
Patch coverage: 57.14% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5347      +/-   ##
==========================================
- Coverage   75.45%   75.34%   -0.12%     
==========================================
  Files         338      338              
  Lines       33655    33774     +119     
==========================================
+ Hits        25396    25448      +52     
- Misses       6065     6126      +61     
- Partials     2194     2200       +6     
Flag Coverage Δ
unittests 75.34% <57.14%> (-0.12%) ⬇️

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

Impacted Files Coverage Δ
pkg/storage/kv/etcd_kv.go 68.25% <53.57%> (+1.11%) ⬆️
pkg/storage/kv/levedb_kv.go 72.91% <60.00%> (-14.04%) ⬇️
pkg/storage/kv/mem_kv.go 78.87% <60.52%> (-21.13%) ⬇️
pkg/errs/errs.go 75.00% <0.00%> (-25.00%) ⬇️
server/region_syncer/server.go 82.96% <0.00%> (-4.40%) ⬇️
server/storage/storage.go 67.30% <0.00%> (-3.85%) ⬇️
pkg/id/id.go 83.05% <0.00%> (-3.39%) ⬇️
server/schedulers/shuffle_hot_region.go 55.12% <0.00%> (-2.57%) ⬇️
pkg/storage/endpoint/meta.go 61.36% <0.00%> (-2.28%) ⬇️
pkg/encryption/key_manager.go 70.11% <0.00%> (-1.60%) ⬇️
... and 13 more

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 at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@AmoebaProtozoa AmoebaProtozoa marked this pull request as ready for review July 27, 2022 05:53
@ti-chi-bot ti-chi-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 27, 2022
@ti-chi-bot ti-chi-bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Dec 9, 2022
@nolouch
Copy link
Contributor

nolouch commented Jan 3, 2023

Hi, @AmoebaProtozoa , would you please resolve the conflicts, I think it's useful.

# Conflicts:
#	pkg/storage/kv/etcd_kv.go
#	pkg/storage/kv/levedb_kv.go
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
@ti-chi-bot ti-chi-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 4, 2023
@ti-chi-bot ti-chi-bot added the status/LGT1 Indicates that a PR has LGTM 1. label Jan 10, 2023
@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 Jan 10, 2023
@disksing
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

@disksing: 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: d60e299

@ti-chi-bot ti-chi-bot added the status/can-merge Indicates a PR has been approved by a committer. label Jan 10, 2023
Signed-off-by: David <8039876+AmoebaProtozoa@users.noreply.github.com>
@ti-chi-bot ti-chi-bot removed the status/can-merge Indicates a PR has been approved by a committer. label Jan 10, 2023
@disksing
Copy link
Contributor

/merge

@ti-chi-bot
Copy link
Member

@disksing: 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: 5f7115e

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

/rebuild

@purelind
Copy link
Contributor

/test build

@ti-chi-bot ti-chi-bot merged commit 1b778f2 into tikv:master Jan 10, 2023
@AmoebaProtozoa AmoebaProtozoa deleted the RunInTxn branch January 10, 2023 09:11
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

9 participants