ddl: add conn and session_alias entry in ddl worker log#46443
ddl: add conn and session_alias entry in ddl worker log#46443ti-chi-bot[bot] merged 2 commits intopingcap:masterfrom
conn and session_alias entry in ddl worker log#46443Conversation
7cdd4a4 to
c32e0ec
Compare
Codecov Report❌ Patch coverage is ❌ Your patch status has failed because the patch coverage (44.8979%) is below the target coverage (85.0000%). You can increase the patch coverage or adjust the target coverage. 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.
🚀 New features to boost your workflow:
|
c32e0ec to
f4c1f09
Compare
|
/retest |
| } | ||
| 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.
Missing w.jobLogger(job) here?
There was a problem hiding this comment.
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.
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.
We check job != nil in line149 before getting traceInfo, how about job.ID?
okJiang
left a comment
There was a problem hiding this comment.
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 DetailsNeeds 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
connorsession_aliasfield 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.