Skip to content

Commit

Permalink
*: change some error logs to warn logs (pingcap#44444)
Browse files Browse the repository at this point in the history
  • Loading branch information
wjhuang2016 authored Jun 6, 2023
1 parent 23ea53a commit 027711d
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion br/pkg/lightning/backend/backend.go
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,11 @@ func (engine *ClosedEngine) Import(ctx context.Context, regionSplitSize, regionS
task := engine.logger.With(zap.Int("retryCnt", i)).Begin(zap.InfoLevel, "import")
err = engine.backend.ImportEngine(ctx, engine.uuid, regionSplitSize, regionSplitKeys)
if !common.IsRetryableError(err) {
task.End(zap.ErrorLevel, err)
if common.ErrFoundDuplicateKeys.Equal(err) {
task.End(zap.WarnLevel, err)
} else {
task.End(zap.ErrorLevel, err)
}
return err
}
task.Warn("import spuriously failed, going to retry again", log.ShortError(err))
Expand Down
2 changes: 1 addition & 1 deletion ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ func (dc *ddlCtx) removeReorgCtx(jobID int64) {
func (dc *ddlCtx) notifyReorgWorkerJobStateChange(job *model.Job) {
rc := dc.getReorgCtx(job.ID)
if rc == nil {
logutil.BgLogger().Error("cannot find reorgCtx", zap.Int64("jobID", job.ID))
logutil.BgLogger().Warn("cannot find reorgCtx", zap.Int64("jobID", job.ID))
return
}
logutil.BgLogger().Info("[ddl] notify reorg worker the job's state",
Expand Down
2 changes: 1 addition & 1 deletion ddl/ddl_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ func (w *worker) countForError(err error, job *model.Job) error {
logutil.Logger(w.logCtx).Info("[ddl] DDL job is cancelled normally", zap.Error(err))
return nil
}
logutil.Logger(w.logCtx).Error("[ddl] run DDL job error", zap.Error(err))
logutil.Logger(w.logCtx).Warn("[ddl] run DDL job error", zap.Error(err))

// Load global DDL variables.
if err1 := loadDDLVars(w); err1 != nil {
Expand Down
6 changes: 5 additions & 1 deletion ddl/ingest/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,11 @@ func (ei *engineInfo) ImportAndClean() error {
zap.String("split region size", strconv.FormatInt(int64(config.SplitRegionSize), 10)))
err = closeEngine.Import(ei.ctx, int64(config.SplitRegionSize), int64(config.SplitRegionKeys))
if err != nil {
logutil.BgLogger().Error(LitErrIngestDataErr, zap.Error(err),
logLevel := zap.ErrorLevel
if common.ErrFoundDuplicateKeys.Equal(err) {
logLevel = zap.WarnLevel
}
logutil.BgLogger().Log(logLevel, LitErrIngestDataErr, zap.Error(err),
zap.Int64("job ID", ei.jobID), zap.Int64("index ID", ei.indexID))
return err
}
Expand Down
2 changes: 1 addition & 1 deletion executor/analyze_global_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (e *AnalyzeExec) handleGlobalStats(ctx context.Context, needGlobalStats boo
globalStatsID.tableID, info.isIndex, info.histIDs,
tableAllPartitionStats)
if err != nil {
logutil.BgLogger().Error("merge global stats failed",
logutil.BgLogger().Warn("merge global stats failed",
zap.String("info", job.JobInfo), zap.Error(err), zap.Int64("tableID", tableID))
if types.ErrPartitionStatsMissing.Equal(err) || types.ErrPartitionColumnStatsMissing.Equal(err) {
// When we find some partition-level stats are missing, we need to report warning.
Expand Down

0 comments on commit 027711d

Please sign in to comment.