Skip to content

Commit

Permalink
feat(server): improve the log to help debugging (#605)
Browse files Browse the repository at this point in the history
### Motivation

Add `leaderTerm` for more information when `newTerm` failed.
  • Loading branch information
mattisonchao authored Feb 11, 2025
1 parent 914d928 commit 81dd079
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/internal_rpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,11 +145,13 @@ func (s *internalRpcServer) NewTerm(c context.Context, req *proto.NewTermRequest
log.Warn(
"New term processing of leader failed",
slog.Any("error", err2),
slog.Int64("leaderTerm", leader.Term()),
)
} else {
log.Info(
"New term processing completed",
slog.Any("response", res),
slog.Int64("leaderTerm", leader.Term()),
)
}
return res, err2
Expand Down

0 comments on commit 81dd079

Please # to comment.