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: do not keep history when the transaction retry is disabled #11192
Conversation
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #11192 +/- ##
===========================================
Coverage 81.3852% 81.3852%
===========================================
Files 423 423
Lines 90584 90584
===========================================
Hits 73722 73722
Misses 11555 11555
Partials 5307 5307 |
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
session/session.go
Outdated
} | ||
|
||
// If retry limit is 0, the transaction could not retry. | ||
couldRetry := sessVars.RetryLimit != 0 |
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.
This may be better.
if sessVars.RetryLimit == 0 {
return false
}
if ... {
return true
}
if ... {
return true
}
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.
done
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
session/session_test.go
Outdated
tk.MustExec("create table history (a int)") | ||
tk.MustExec("insert history values (1)") | ||
|
||
// Firstly, disable retry. |
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.
Firstly enable retry?
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.
Fixed.
Signed-off-by: Shuaipeng Yu <jackysp@gmail.com>
LGTM |
/run-all-tests |
LGTM |
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.
LGTM
Signed-off-by: Shuaipeng Yu jackysp@gmail.com
What problem does this PR solve?
If the transaction retry is disabled, it is not necessary to add history.
What is changed and how it works?
Do not keep history when the transaction retry is disabled.
Check List
Tests
Make many statements in one transaction, the memory of statement context released in this PR.
Code changes
Side effects
If we don't keep history, the stmt-count-limit is useless.
Related changes