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: replace logger with zap logger #9521

Merged
merged 12 commits into from
Mar 14, 2019
Merged

executor: replace logger with zap logger #9521

merged 12 commits into from
Mar 14, 2019

Conversation

alivxxx
Copy link
Contributor

@alivxxx alivxxx commented Mar 1, 2019

What problem does this PR solve?

Unify log format in package executor.

What is changed and how it works?

Replace log package with zap logger and follow the new log format.

Check List

Tests

  • No code

Code changes

  • None

Side effects

  • None

Related changes

  • Need to cherry-pick to the release branch

@alivxxx alivxxx added type/enhancement The issue or PR belongs to an enhancement. sig/execution SIG execution labels Mar 1, 2019
@alivxxx
Copy link
Contributor Author

alivxxx commented Mar 1, 2019

/rebuild

executor/admin.go Outdated Show resolved Hide resolved
executor/aggregate.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Mar 9, 2019

Codecov Report

Merging #9521 into master will decrease coverage by 0.0054%.
The diff coverage is 26.7857%.

@@               Coverage Diff                @@
##             master      #9521        +/-   ##
================================================
- Coverage   67.3389%   67.3334%   -0.0055%     
================================================
  Files           378        378                
  Lines         79535      79540         +5     
================================================
- Hits          53558      53557         -1     
- Misses        21194      21201         +7     
+ Partials       4783       4782         -1

@@ -393,8 +395,9 @@ func (e *RecoverIndexExec) batchMarkDup(txn kv.Transaction, rows []recoverRows)
}

if handle != rows[i].handle {
log.Warnf("[recover-index] The constraint of unique index:%v is broken, handle:%v is not equal handle:%v with idxKey:%v.",
e.index.Meta().Name.O, handle, rows[i].handle, key)
log.Warn("The constraint of unique index is broken when recovering index",
Copy link
Member

Choose a reason for hiding this comment

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

Should we print [recover-index] prefix? @zimulala What's your opinion?

executor/admin.go Outdated Show resolved Hide resolved
executor/aggregate.go Outdated Show resolved Hide resolved
executor/aggregate.go Outdated Show resolved Hide resolved
executor/ddl.go Outdated Show resolved Hide resolved
executor/admin.go Outdated Show resolved Hide resolved
executor/aggregate.go Outdated Show resolved Hide resolved
executor/distsql.go Outdated Show resolved Hide resolved
executor/compiler.go Outdated Show resolved Hide resolved
executor/distsql.go Outdated Show resolved Hide resolved
executor/index_lookup_join.go Show resolved Hide resolved
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

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

LGTM

@alivxxx alivxxx added the status/LGT1 Indicates that a PR has LGTM 1. label Mar 13, 2019
@alivxxx alivxxx requested a review from XuHuaiyu March 14, 2019 02:54
XuHuaiyu
XuHuaiyu previously approved these changes Mar 14, 2019
Copy link
Contributor

@XuHuaiyu XuHuaiyu left a comment

Choose a reason for hiding this comment

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

LGTM

@XuHuaiyu XuHuaiyu added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Mar 14, 2019
executor/admin.go Show resolved Hide resolved
executor/admin.go Outdated Show resolved Hide resolved
executor/aggregate.go Outdated Show resolved Hide resolved
executor/load_data.go Outdated Show resolved Hide resolved
eurekaka
eurekaka previously approved these changes Mar 14, 2019
Copy link
Contributor

@eurekaka eurekaka left a comment

Choose a reason for hiding this comment

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

LGTM

@alivxxx
Copy link
Contributor Author

alivxxx commented Mar 14, 2019

/run-all-tests

@alivxxx alivxxx merged commit f738ba2 into pingcap:master Mar 14, 2019
@alivxxx alivxxx deleted the log branch March 14, 2019 07:14
@@ -390,13 +390,11 @@ func (a *ExecStmt) LogSlowQuery(txnTS uint64, succ bool) {
}
execDetail := sessVars.StmtCtx.GetExecDetails()
if costTime < threshold {
if logutil.SlowQueryLogger.IsLevelEnabled(log.DebugLevel) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is useful 🤣

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/execution SIG execution status/LGT2 Indicates that a PR has LGTM 2. type/enhancement The issue or PR belongs to an enhancement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants