Skip to content

Commit

Permalink
store/copr: fix tracing for copr.buildCopTasks (pingcap#53086)
Browse files Browse the repository at this point in the history
  • Loading branch information
time-and-fate authored and RidRisR committed May 23, 2024
1 parent b921807 commit 41f4964
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pkg/store/copr/coprocessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ type buildCopTaskOpt struct {
func buildCopTasks(bo *Backoffer, ranges *KeyRanges, opt *buildCopTaskOpt) ([]*copTask, error) {
req, cache, eventCb, hints := opt.req, opt.cache, opt.eventCb, opt.rowHints
start := time.Now()
defer tracing.StartRegion(bo.GetCtx(), "copr.buildCopTasks").End()
cmdType := tikvrpc.CmdCop
if req.StoreType == kv.TiDB {
return buildTiDBMemCopTasks(ranges, req)
Expand Down Expand Up @@ -458,9 +459,6 @@ func buildCopTasks(bo *Backoffer, ranges *KeyRanges, opt *buildCopTaskOpt) ([]*c
zap.Int("range len", rangesLen),
zap.Int("task len", len(tasks)))
}
if elapsed > time.Millisecond {
defer tracing.StartRegion(bo.GetCtx(), "copr.buildCopTasks").End()
}
if opt.elapsed != nil {
*opt.elapsed = *opt.elapsed + elapsed
}
Expand Down

0 comments on commit 41f4964

Please sign in to comment.