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: make set system variable log shorter #7029

Merged
merged 3 commits into from Jul 11, 2018

Conversation

@coocood
Copy link
Member

commented Jul 10, 2018

What have you changed? (mandatory)

make set system variable log shorter

What are the type of the changes (mandatory)?

  • Improvement (non-breaking change which is an improvement to an existing feature)

Some application change system variable a lot, logging in short format saves disk space.

How has this PR been tested (mandatory)?

Manual

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)

This comment has been minimized.

Copy link
@zz-jason

zz-jason Jul 10, 2018

Member

do we need to keep this format [con:%d]?

This comment has been minimized.

Copy link
@coocood

coocood Jul 11, 2018

Author Member

There are places where con: is not enclosed by '[]'.
How about we should remove all the [] that enclosing con:?

This comment has been minimized.

Copy link
@lysu

lysu Jul 11, 2018

Member

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?

@@ -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)

This comment has been minimized.

Copy link
@zimulala

zimulala Jul 11, 2018

Member

s/[schema ver:%d]/schema_ver:%d?

Copy link
Member

left a comment

LGTM

Copy link
Member

left a comment

LGTM

@zimulala zimulala dismissed zz-jason’s stale review Jul 11, 2018

Please address my comment.

@coocood

This comment has been minimized.

Copy link
Member Author

commented Jul 11, 2018

/run-all-tests

Copy link
Member

left a comment

LGTM

@zz-jason zz-jason merged commit f9a5686 into pingcap:master Jul 11, 2018
11 checks passed
11 checks passed
ci/circleci Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci-tidb/build Jenkins job succeeded.
Details
jenkins-ci-tidb/common-test Jenkins job succeeded.
Details
jenkins-ci-tidb/integration-common-test Jenkins job succeeded.
Details
jenkins-ci-tidb/integration-compatibility-test Jenkins job succeeded.
Details
jenkins-ci-tidb/integration-ddl-test Jenkins job succeeded.
Details
jenkins-ci-tidb/mybatis-test Jenkins job succeeded.
Details
jenkins-ci-tidb/sqllogic-test Jenkins job succeeded.
Details
jenkins-ci-tidb/unit-test Jenkins job succeeded.
Details
license/cla Contributor License Agreement is signed.
Details
@coocood coocood deleted the coocood:shorter-log branch Jul 11, 2018
zhexuany added a commit to zhexuany/tidb that referenced this pull request Jul 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.