Skip to content

Commit

Permalink
refactor: range task log with more accurate info (#657)
Browse files Browse the repository at this point in the history
Signed-off-by: fengou1 <feng.ou@pingcap.com>
  • Loading branch information
fengou1 authored Jan 12, 2023
1 parent f2ff1ce commit fe5b35c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion txnkv/rangetask/range_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,11 @@ Loop:

rangeEndKey, err := s.store.GetRegionCache().BatchLoadRegionsFromKey(bo, key, s.regionsPerTask)
if err != nil {
logutil.Logger(ctx).Info("range task failed",
logutil.Logger(ctx).Info("range task try to get range end key failure",
zap.String("name", s.name),
zap.String("startKey", kv.StrKey(startKey)),
zap.String("endKey", kv.StrKey(endKey)),
zap.String("loadRegionKey", kv.StrKey(key)),
zap.Duration("cost time", time.Since(startTime)),
zap.Error(err))
return err
Expand Down Expand Up @@ -235,6 +236,8 @@ Loop:
zap.String("startKey", kv.StrKey(startKey)),
zap.String("endKey", kv.StrKey(endKey)),
zap.Duration("cost time", time.Since(startTime)),
zap.Int("completed regions", s.CompletedRegions()),
zap.Int("failed regions", s.FailedRegions()),
zap.Error(w.err))
return errors.WithStack(w.err)
}
Expand Down

0 comments on commit fe5b35c

Please sign in to comment.