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

session: add test case for retrying union statement #15051

Merged
merged 2 commits into from
Mar 4, 2020

Conversation

djshow832
Copy link
Contributor

What problem does this PR solve?

Add test case for #15050.

What is changed and how it works?

Just add some test cases to test retrying UNION and SHOW statements.

Check List

Tests

  • Unit test
  • Manual test

I did the same as #15050 and the log shows UNION statement is not retried.

[2020/03/01 18:12:15.574 +08:00] [WARN] [session.go:463] [sql] [conn=1] [label=general] [error="[kv:9007]Write conflict, txnStartTS=414989028796923904, conflictStartTS=414989031736606720, conflictCommitTS=414989031736606721, key={tableID=45, handle=120001} primary=[]byte(nil) [try again later]"] [txn="Txn{state=invalid}"]
[2020/03/01 18:12:15.574 +08:00] [WARN] [session.go:655] [retrying] [conn=1] [schemaVersion=36] [retryCnt=0] [queryNum=0] [sql=begin]
[2020/03/01 18:12:15.575 +08:00] [INFO] [2pc.go:1074] ["2PC clean up done"] [conn=1] [txnStartTS=414989028796923904]
[2020/03/01 18:12:15.575 +08:00] [WARN] [session.go:655] [retrying] [conn=1] [schemaVersion=36] [retryCnt=0] [queryNum=1] [sql="update test set id=id+1"]
[2020/03/01 18:12:15.575 +08:00] [WARN] [session.go:655] [retrying] [conn=1] [schemaVersion=36] [retryCnt=0] [queryNum=2] [sql=commit]

Code changes

N/A

Side effects

N/A

Related changes

N/A

Release note ( This release note applies to the parser PR pingcap/parser#755)

  • Fix the bug that goroutine leaks when retrying a transaction which contains UNION statement.

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

@djshow832 djshow832 added priority/release-blocker This issue blocks a release. Please solve it ASAP. and removed priority/release-blocker This issue blocks a release. Please solve it ASAP. labels Mar 2, 2020
@djshow832 djshow832 force-pushed the txn_retry_memory_leak branch from dc86a80 to 19ba7cd Compare March 3, 2020 10:24
@djshow832 djshow832 requested review from bb7133 and AilinKid March 3, 2020 10:25
@djshow832 djshow832 force-pushed the txn_retry_memory_leak branch from 19ba7cd to 8bb0f62 Compare March 4, 2020 02:52
@djshow832
Copy link
Contributor Author

/run-all-tests

@codecov
Copy link

codecov bot commented Mar 4, 2020

Codecov Report

Merging #15051 into master will decrease coverage by 0.015%.
The diff coverage is n/a.

@@              Coverage Diff               @@
##           master     #15051        +/-   ##
==============================================
- Coverage    80.3%   80.2849%   -0.0151%     
==============================================
  Files         502        502                
  Lines      131980     131940        -40     
==============================================
- Hits       105980     105928        -52     
- Misses      17618      17625         +7     
- Partials     8382       8387         +5

Copy link
Contributor

@AilinKid AilinKid left a comment

Choose a reason for hiding this comment

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

LGTM

@djshow832
Copy link
Contributor Author

/merge

@sre-bot sre-bot added the status/can-merge Indicates a PR has been approved by a committer. label Mar 4, 2020
@sre-bot
Copy link
Contributor

sre-bot commented Mar 4, 2020

/run-all-tests

@sre-bot sre-bot merged commit 9243864 into pingcap:master Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/session status/can-merge Indicates a PR has been approved by a committer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants