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

executor: use before statement snapshot for UnionScan #19841

Merged
merged 2 commits into from
Sep 9, 2020

Conversation

bobotu
Copy link
Contributor

@bobotu bobotu commented Sep 7, 2020

What problem does this PR solve?

Issue Number: close #19054

What's Changed:

Cherry-pick #19276 to release-3.0

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch

Release note

  • Fix data race in UnionScan

Co-authored-by: ti-srebot <66930949+ti-srebot@users.noreply.github.com>
Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

Missing the test cases?

@bobotu
Copy link
Contributor Author

bobotu commented Sep 8, 2020

MySQL [test]> explain update /*+ TIDB_INLJ(t1) */ t t1, (select a, b from t) t2 set t1.b = t2.b where t1.a = t2.a + 1000;
+----------------------------+----------+------+------------------------------------------------------------------------------+
| id                         | count    | task | operator info                                                                |
+----------------------------+----------+------+------------------------------------------------------------------------------+
| Update_8                   | N/A      | root | N/A                                                                          |
| └─HashLeftJoin_10          | 99998.00 | root | inner join, inner:Projection_16, equal:[eq(test.t1.a, plus(test.t.a, 1000))] |
|   ├─UnionScan_13           | 99998.00 | root |                                                                              |
|   │ └─TableReader_15       | 99998.00 | root | data:TableScan_14                                                            |
|   │   └─TableScan_14       | 99998.00 | cop  | table:t, range:[-inf,+inf], keep order:false                                 |
|   └─Projection_16          | 99998.00 | root | test.t.a, test.t.b, plus(test.t.a, 1000)                                     |
|     └─UnionScan_17         | 99998.00 | root |                                                                              |
|       └─TableReader_19     | 99998.00 | root | data:TableScan_18                                                            |
|         └─TableScan_18     | 99998.00 | cop  | table:t, range:[-inf,+inf], keep order:false                                 |
+----------------------------+----------+------+------------------------------------------------------------------------------+

The execution plan in v3.0 seems cannot reproduce race.

Copy link
Member

@jackysp jackysp left a comment

Choose a reason for hiding this comment

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

LGTM

@ti-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Sep 8, 2020
@cfzjywxk
Copy link
Contributor

cfzjywxk commented Sep 8, 2020

LGTM

@ti-srebot ti-srebot removed the status/LGT1 Indicates that a PR has LGTM 1. label Sep 8, 2020
@ti-srebot ti-srebot added the status/LGT2 Indicates that a PR has LGTM 2. label Sep 8, 2020
@qw4990
Copy link
Contributor

qw4990 commented Sep 9, 2020

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Sep 9, 2020
@ti-srebot
Copy link
Contributor

/run-all-tests

@ti-srebot
Copy link
Contributor

@bobotu merge failed.

@qw4990
Copy link
Contributor

qw4990 commented Sep 9, 2020

/rebuild

1 similar comment
@qw4990
Copy link
Contributor

qw4990 commented Sep 9, 2020

/rebuild

@qw4990 qw4990 merged commit 40a147c into pingcap:release-3.0 Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution 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.

5 participants