Skip to content

Commit

Permalink
session: update logs
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala committed Aug 16, 2023
1 parent 179fa9d commit 521fe54
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions session/bootstrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -1261,7 +1261,7 @@ func SyncUpgradeState(s Session) error {
dom := domain.GetDomain(s)
err := dom.DDL().StateSyncer().UpdateGlobalState(ctx, syncer.NewStateInfo(syncer.StateUpgrading))
if err != nil {
logutil.BgLogger().Error("[upgrading] update global state failed", zap.String("state", syncer.StateUpgrading), zap.Error(err))
logutil.BgLogger().Error("update global state failed", zap.String("category", "upgrading"), zap.String("state", syncer.StateUpgrading), zap.Error(err))
return err

Check warning on line 1265 in session/bootstrap.go

View check run for this annotation

Codecov / codecov/patch

session/bootstrap.go#L1264-L1265

Added lines #L1264 - L1265 were not covered by tests
}

Expand All @@ -1273,7 +1273,7 @@ func SyncUpgradeState(s Session) error {
break
}
if i == retryTimes-1 {
logutil.BgLogger().Error("[upgrading] get owner op failed", zap.Stringer("state", op), zap.Error(err))
logutil.BgLogger().Error("get owner op failed", zap.String("category", "upgrading"), zap.Stringer("state", op), zap.Error(err))
return err

Check warning on line 1277 in session/bootstrap.go

View check run for this annotation

Codecov / codecov/patch

session/bootstrap.go#L1276-L1277

Added lines #L1276 - L1277 were not covered by tests
}
if i%10 == 0 {
Expand Down Expand Up @@ -1301,7 +1301,7 @@ func SyncUpgradeState(s Session) error {
}

if i == retryTimes-1 {
logutil.BgLogger().Error("[upgrading] pause all jobs failed", zap.Strings("errs", jobErrStrs), zap.Error(err))
logutil.BgLogger().Error("pause all jobs failed", zap.String("category", "upgrading"), zap.Strings("errs", jobErrStrs), zap.Error(err))
return err

Check warning on line 1305 in session/bootstrap.go

View check run for this annotation

Codecov / codecov/patch

session/bootstrap.go#L1304-L1305

Added lines #L1304 - L1305 were not covered by tests
}
logutil.BgLogger().Warn("pause all jobs failed", zap.String("category", "upgrading"), zap.Strings("errs", jobErrStrs), zap.Error(err))
Expand Down Expand Up @@ -1335,7 +1335,7 @@ func SyncNormalRunning(s Session) error {
dom := domain.GetDomain(s)
err = dom.DDL().StateSyncer().UpdateGlobalState(ctx, syncer.NewStateInfo(syncer.StateNormalRunning))
if err != nil {
logutil.BgLogger().Error("[upgrading] update global state to normal failed", zap.Error(err))
logutil.BgLogger().Error("update global state to normal failed", zap.String("category", "upgrading"), zap.Error(err))
return err

Check warning on line 1339 in session/bootstrap.go

View check run for this annotation

Codecov / codecov/patch

session/bootstrap.go#L1338-L1339

Added lines #L1338 - L1339 were not covered by tests
}
logutil.BgLogger().Info("update global state to normal running finished", zap.String("category", "upgrading"))
Expand Down

0 comments on commit 521fe54

Please sign in to comment.