-
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
log: move autocommit varable value into connection info #12310
Conversation
Codecov Report
@@ Coverage Diff @@
## master #12310 +/- ##
===========================================
Coverage 79.9653% 79.9653%
===========================================
Files 460 460
Lines 103221 103221
===========================================
Hits 82541 82541
Misses 14684 14684
Partials 5996 5996 |
server/conn.go
Outdated
autoCommit = 1 | ||
} | ||
return fmt.Sprintf("id:%d, addr:%s status:%d, collation:%s, user:%s autocommit:%d", | ||
cc.connectionID, cc.bufReadConn.RemoteAddr(), cc.ctx.Status(), collationStr, cc.user, autoCommit, |
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.
I think it is better to format the output of cc.ctx.Status()
. Because it already contains the autocommit status.
@@ -188,7 +188,9 @@ func (e *SetExecutor) setSysVariable(name string, v *expression.VarAssignment) e | |||
valStr, err = value.ToString() | |||
terror.Log(err) | |||
} | |||
logutil.BgLogger().Info("set session var", zap.Uint64("conn", sessionVars.ConnectionID), zap.String("name", name), zap.String("val", valStr)) | |||
if name != variable.AutoCommit { | |||
logutil.BgLogger().Info("set session var", zap.Uint64("conn", sessionVars.ConnectionID), zap.String("name", name), zap.String("val", valStr)) |
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.
93bdb0b
to
f6f925c
Compare
LGTM |
/run-all-tests tidb-test=pr/875 |
/run-all-tests tidb-test=pr/875 |
/run-common-test tidb-test=pr/875 |
/run-all-tests tidb-test=pr/875 |
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
/run-all-tests |
@imtbkcat merge failed. |
/merge |
/run-all-tests |
@imtbkcat merge failed. |
/merge |
/run-all-tests |
@imtbkcat merge failed. |
/run-check_dev |
cherry pick to release-3.0 failed |
cherry pick to release-2.1 failed |
cherry pick to release-3.1 failed |
What problem does this PR solve?
Some applications will set
autocommit
variable every time when they execute queries. This action will make tidb log full ofset session var
.What is changed and how it works?
I remove this log info for
autocommit
variable and addautocommit
value when print connection information into log.just like:
["command dispatched failed"] [conn=2] [connInfo="id:2, addr:127.0.0.1:52703 status:0, collation:utf8_general_ci, user:root autocommit:0"]
Check List
Tests
Code changes
Side effects
Related changes
Release note