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
Conversation
/run-all-tests |
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", |
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/tbls/tableIDs:/
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.
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.
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.
And when OPS see this log, he might thought: "what the fuck?"
session/session.go
Outdated
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())) |
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.
ver-> schemVer
/run-unit-test |
1 similar comment
/run-unit-test |
/run-all-tests |
@zimulala Please address the comments. |
PTAL @shenli @tiancaiamao |
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
Add information schema version to the log.