-
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
ddl: add conn
and session_alias
entry in ddl worker log
#46443
Conversation
7cdd4a4
to
c32e0ec
Compare
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #46443 +/- ##
================================================
- Coverage 73.4208% 72.7314% -0.6894%
================================================
Files 1295 1320 +25
Lines 393759 400924 +7165
================================================
+ Hits 289101 291598 +2497
- Misses 86294 90848 +4554
- Partials 18364 18478 +114
Flags with carried forward coverage won't be shown. Click here to find out more.
|
c32e0ec
to
f4c1f09
Compare
/retest |
@@ -167,7 +178,7 @@ func (w *worker) Close() { | |||
w.sessPool.Put(w.sess.Session()) | |||
} | |||
w.wg.Wait() | |||
logutil.Logger(w.logCtx).Info("DDL worker closed", zap.String("category", "ddl"), zap.Duration("take time", time.Since(startTime))) | |||
logutil.Logger(w.logCtx).Info("DDL worker closed", zap.Duration("take time", time.Since(startTime))) |
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.
Missing w.jobLogger(job)
here?
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 is no job ref here because the stop method is not related to any job. I removed zap.String("category", "ddl")
because the logger in w.logCtx
contains this field already: https://github.com/pingcap/tidb/pull/46443/files#diff-dfc42c5764e7e4ff9122a1db728ff1cb0dee56e72dbccefdb211018ccd444c73R143
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.
Ok, but I see that your function(jobLogger
) actually has a check to determine if the job is empty. So I'm asking.
ddl/ddl_worker.go
Outdated
traceInfo = job.TraceInfo | ||
} | ||
return logutil.LoggerWithTraceInfo( | ||
logutil.Logger(w.logCtx).With(zap.Int64("jobID", job.ID)), |
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.
We check job != nil
in line149 before getting traceInfo
, how about job.ID
?
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.
done
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 except existed conversation
/hold |
/unhold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: okJiang, tangenta, zimulala The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
What problem does this PR solve?
Issue Number: close #46441, ref #46071
What is changed and how it works?
After this PR, we can trace the ddl worker logs by
conn
orsession_alias
field to figure out where this ddl job come from, for example:log:
Check List
Tests
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.