-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
txn: implement staging for Pipelined DML #51832
Conversation
Signed-off-by: ekexium <[email protected]>
Hi @ekexium. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. 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 kubernetes/test-infra repository. |
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #51832 +/- ##
=================================================
- Coverage 70.6586% 54.7876% -15.8710%
=================================================
Files 1477 1588 +111
Lines 438466 609031 +170565
=================================================
+ Hits 309814 333674 +23860
- Misses 109184 252210 +143026
- Partials 19468 23147 +3679
Flags with carried forward coverage won't be shown. Click here to find out more.
|
/retest |
@ekexium: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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 kubernetes/test-infra repository. |
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
Signed-off-by: ekexium <[email protected]>
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.
There is a similar but simpler test in pipelineddml_test package, can you uncomment the result check code, rest LGTM
tidb/tests/realtikvtest/pipelineddmltest/pipelineddml_test.go
Lines 697 to 708 in af76c2f
func TestInsertIgnoreOnDuplicateKeyUpdate(t *testing.T) { | |
store := realtikvtest.CreateMockStoreAndSetup(t) | |
tk := testkit.NewTestKit(t, store) | |
tk.MustExec("set session tidb_dml_type = bulk") | |
tk.MustExec("use test") | |
tk.MustExec("drop table if exists t1") | |
tk.MustExec("create table t1(a int, b int, unique index u1(a, b), unique index u2(a))") | |
tk.MustExec("insert into t1 values(0, 0), (1, 1)") | |
tk.MustExecToErr("insert ignore into t1 values (0, 2) ,(1, 3) on duplicate key update b = 5, a = 0") | |
// if the statement execute successful, the following check should pass. | |
// tk.MustQuery("select * from t1").Sort().Check(testkit.Rows("0 5", "1 1")) | |
} |
Signed-off-by: ekexium <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfzjywxk, you06 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 |
/retest |
@ekexium: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
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 kubernetes/test-infra repository. |
What problem does this PR solve?
Issue Number: ref #50215
Problem Summary:
The lack of support for staging interface leads to incorrect behavior when part of the stmt can fail but the whole stmt succeeds.
What changed and how does it work?
Implement the staging interface for pipelined DML. Its correctness is guaranteed by that no stage can exist when a
Flush()
is called. Every stage lives inside a flush batch, which means the modifications all goes to the mutable memdb. Thus the staging of the whole PipeliendMemDB can be directly implemented by the memdb.Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.