Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
mattisonchao committed Nov 15, 2024
1 parent 0a03e89 commit 95ceaf7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/leader_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -912,23 +912,27 @@ func (lc *leaderController) handleWriteStream(closeStreamSignal chan error, stre
lc.appendToWalStreamRequest(writeRequest, func(offset int64, timestamp uint64, err error) {
if err != nil {
latencyTimer.Done()
slog.Debug("Got an callback error when write to wal", slog.Any("error", err))
lastCallbackError.Store(&err)
return
}
lc.quorumAckTracker.WaitForCommitOffsetAsync(stream.Context(), offset, func(_ context.Context, innerErr error) {
if innerErr != nil {
latencyTimer.Done()
slog.Debug("Got an callback error when write to wal", slog.Any("error", err))
lastCallbackError.Store(&err)
return
}
var writeResponse *proto.WriteResponse
if writeResponse, err = lc.db.ProcessWrite(writeRequest, offset, timestamp, WrapperUpdateOperationCallback); err != nil {
latencyTimer.Done()
slog.Debug("Got an callback error when write to wal", slog.Any("error", err))
lastCallbackError.Store(&err)
return
}
if err = stream.Send(writeResponse); err != nil {
latencyTimer.Done()
slog.Debug("Got an callback error when write to wal", slog.Any("error", err))
lastCallbackError.Store(&err)
return
}
Expand Down

0 comments on commit 95ceaf7

Please sign in to comment.