Skip to content

Commit

Permalink
executor: add log for commit work (pingcap#13965)
Browse files Browse the repository at this point in the history
  • Loading branch information
cfzjywxk authored and XiaTianliang committed Dec 21, 2019
1 parent 9c59541 commit 65ffb21
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions executor/load_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"context"
"fmt"
"strings"
"time"

"github.com/pingcap/errors"
"github.com/pingcap/failpoint"
Expand Down Expand Up @@ -243,11 +244,17 @@ func (e *LoadDataInfo) CommitWork(ctx context.Context) error {
break
case commitTask, ok := <-e.commitTaskQueue:
if ok {
start := time.Now()
err = e.CommitOneTask(ctx, commitTask)
if err != nil {
break
}
tasks++
logutil.Logger(ctx).Info("commit one task success",
zap.Duration("commit time usage", time.Since(start)),
zap.Uint64("keys processed", commitTask.cnt),
zap.Uint64("tasks processed", tasks),
zap.Int("tasks in queue", len(e.commitTaskQueue)))
} else {
end = true
break
Expand Down Expand Up @@ -485,6 +492,7 @@ func (e *LoadDataInfo) addRecordLD(ctx context.Context, row []types.Datum) (int6
h, err := e.addRecord(ctx, row)
if err != nil {
e.handleWarning(err)
return 0, err
}
return h, nil
}
Expand Down

0 comments on commit 65ffb21

Please sign in to comment.