-
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
executor: make set system variable log shorter #7029
Conversation
Some application change system variable a lot, logging in short format saves disk space.
@@ -178,7 +178,7 @@ func (e *SetExecutor) setSysVariable(name string, v *expression.VarAssignment) e | |||
valStr, err = value.ToString() | |||
terror.Log(errors.Trace(err)) | |||
} | |||
log.Infof("[con:%d] set system variable %s = %s", sessionVars.ConnectionID, name, valStr) | |||
log.Infof("con:%d %s=%s", sessionVars.ConnectionID, name, 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.
do we need to keep this format [con:%d]
?
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 are places where con:
is not enclosed by '[]'.
How about we should remove all the []
that enclosing con:
?
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.
should we more shorter use c:
instead of conn:
?
and I have a idea: maybe we encapsulation all log method and in ctx idioms
, in the method body it use prealloc log header in thread load level(e.g. "c:123, tx:12, tr:33"
), then need for every place to to fomat conn mannul, and no need to alloc header part every time?
session/session.go
Outdated
@@ -986,7 +986,7 @@ func (s *session) NewTxn() error { | |||
return errors.Trace(err) | |||
} | |||
vars := s.GetSessionVars() | |||
log.Infof("[con:%d][schema ver:%d] NewTxn() inside a transaction auto commit: %d", vars.ConnectionID, vars.TxnCtx.SchemaVersion, txnID) | |||
log.Infof("con:%d[schema ver:%d] NewTxn() inside a transaction auto commit: %d", vars.ConnectionID, vars.TxnCtx.SchemaVersion, txnID) |
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.
s/[schema ver:%d]
/schema_ver:%d
?
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
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 |
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
What have you changed? (mandatory)
make set system variable log shorter
What are the type of the changes (mandatory)?
Some application change system variable a lot, logging in short format saves disk space.
How has this PR been tested (mandatory)?
Manual