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

*: add schema version to the log #6527

Merged
merged 6 commits into from May 18, 2018
Merged

*: add schema version to the log #6527

merged 6 commits into from May 18, 2018

Conversation

zimulala
Copy link
Contributor

Add information schema version to the log.

@zimulala
Copy link
Contributor Author

/run-all-tests

@zimulala
Copy link
Contributor Author

PTAL @tiancaiamao @coocood @shenli

domain/domain.go Outdated
@@ -99,8 +99,8 @@ func (do *Domain) loadInfoSchema(handle *infoschema.Handle, usedSchemaVersion in
log.Errorf("[ddl] failed to load schema diff err %v", err)
}
if ok {
log.Infof("[ddl] diff load InfoSchema from version %d to %d, in %v",
usedSchemaVersion, latestSchemaVersion, time.Since(startTime))
log.Infof("[ddl] diff load InfoSchema from version %d to %d in %v, tbls %v",
Copy link
Member

Choose a reason for hiding this comment

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

s/tbls/tableIDs:/

Copy link
Contributor

Choose a reason for hiding this comment

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

It's better not to use abbreviation here.
If we're reading this function, this is OK because we have the context information, but when it used in log, we have no idea what's the abbreviation for.

Copy link
Contributor

Choose a reason for hiding this comment

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

And when OPS see this log, he might thought: "what the fuck?"

if err != nil {
return errors.Trace(err)
}

if retryCnt == 0 {
// We do not have to log the query every time.
// We print the queries at the first try only.
log.Warnf("[%d] Retry [%d] query [%d] %s", connID, retryCnt, i, sqlForLog(st.OriginText()))
log.Warnf("[con:%d][ver:%d] Retry [%d] query [%d] %s", connID, schemaVersion, retryCnt, i, sqlForLog(st.OriginText()))
Copy link
Member

Choose a reason for hiding this comment

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

ver-> schemVer

@zimulala
Copy link
Contributor Author

/run-unit-test

1 similar comment
@zimulala
Copy link
Contributor Author

/run-unit-test

@shenli
Copy link
Member

shenli commented May 13, 2018

/run-all-tests

@shenli
Copy link
Member

shenli commented May 14, 2018

@zimulala Please address the comments.

@zimulala
Copy link
Contributor Author

PTAL @shenli @tiancaiamao

@tiancaiamao
Copy link
Contributor

LGTM

@tiancaiamao tiancaiamao added 1.0-cherry-pick status/LGT1 Indicates that a PR has LGTM 1. and removed 1.0-cherry-pick labels May 15, 2018
Copy link
Contributor

@winkyao winkyao left a comment

Choose a reason for hiding this comment

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

LGTM

@zimulala zimulala added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels May 18, 2018
@coocood coocood merged commit ce0c9f3 into pingcap:master May 18, 2018
@zimulala zimulala deleted the ver-log branch November 30, 2018 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants