Skip to content

Commit

Permalink
ddl: improve log messages (#39376)
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored Nov 29, 2022
1 parent 1dd7a59 commit 9689b47
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ bazel_test: failpoint-enable bazel_ci_prepare


bazel_coverage_test: failpoint-enable bazel_ci_prepare
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) --remote_download_minimal \
bazel $(BAZEL_GLOBAL_CONFIG) coverage $(BAZEL_CMD_CONFIG) \
--build_event_json_file=bazel_1.json --@io_bazel_rules_go//go/config:cover_format=go_cover \
-- //... -//cmd/... -//tests/graceshutdown/... \
-//tests/globalkilltest/... -//tests/readonlytest/... -//br/pkg/task:task_test -//tests/realtikvtest/...
Expand Down
7 changes: 5 additions & 2 deletions ddl/ddl.go
Original file line number Diff line number Diff line change
Expand Up @@ -1217,8 +1217,10 @@ func (d *ddl) SwitchConcurrentDDL(toConcurrentDDL bool) error {
}
if err == nil {
variable.EnableConcurrentDDL.Store(toConcurrentDDL)
logutil.BgLogger().Info("[ddl] SwitchConcurrentDDL", zap.Bool("toConcurrentDDL", toConcurrentDDL))
} else {
logutil.BgLogger().Warn("[ddl] SwitchConcurrentDDL", zap.Bool("toConcurrentDDL", toConcurrentDDL), zap.Error(err))
}
logutil.BgLogger().Info("[ddl] SwitchConcurrentDDL", zap.Bool("toConcurrentDDL", toConcurrentDDL), zap.Error(err))
return err
}

Expand Down Expand Up @@ -1279,9 +1281,10 @@ func (d *ddl) SwitchMDL(enable bool) error {
return err
})
if err != nil {
logutil.BgLogger().Warn("[ddl] switch metadata lock feature", zap.Bool("enable", enable), zap.Error(err))
return err
}
logutil.BgLogger().Info("[ddl] switch metadata lock feature", zap.Bool("enable", enable), zap.Error(err))
logutil.BgLogger().Info("[ddl] switch metadata lock feature", zap.Bool("enable", enable))
return nil
}

Expand Down
7 changes: 6 additions & 1 deletion ddl/reorg.go
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,12 @@ func (w *worker) runReorgJob(rh *reorgHandler, reorgInfo *reorgInfo, tblInfo *mo
return dbterror.ErrCancelledDDLJob
}
rowCount, _, _ := rc.getRowCountAndKey()
logutil.BgLogger().Info("[ddl] run reorg job done", zap.Int64("handled rows", rowCount), zap.Error(err))
if err != nil {
logutil.BgLogger().Warn("[ddl] run reorg job done", zap.Int64("handled rows", rowCount), zap.Error(err))
} else {
logutil.BgLogger().Info("[ddl] run reorg job done", zap.Int64("handled rows", rowCount))
}

job.SetRowCount(rowCount)

// Update a job's warnings.
Expand Down
6 changes: 5 additions & 1 deletion meta/autoid/autoid_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,11 @@ func (sp *singlePointAlloc) resetConn() {
// Close grpc.ClientConn to release resource.
if grpcConn != nil {
err := grpcConn.Close()
logutil.BgLogger().Info("[autoid client] AllocAutoID grpc error, reconnect", zap.Error(err))
if err != nil {
logutil.BgLogger().Warn("[autoid client] AllocAutoID grpc error, reconnect", zap.Error(err))
} else {
logutil.BgLogger().Info("[autoid client] AllocAutoID grpc error, reconnect")
}
}
}

Expand Down

0 comments on commit 9689b47

Please sign in to comment.