Skip to content

Commit

Permalink
Merge pull request #88245 from tbg/backport21.2-86645
Browse files Browse the repository at this point in the history
  • Loading branch information
tbg authored Sep 20, 2022
2 parents 8612c8a + b1b17b2 commit 12b7c9d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/kv/kvserver/raft_transport.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,9 @@ func (t *RaftTransport) SendAsync(req *RaftMessageRequest, class rpc.ConnectionC
}
return true
default:
if logRaftSendQueueFullEvery.ShouldLog() {
log.Warningf(t.AnnotateCtx(context.Background()), "raft send queue to n%d is full", toNodeID)
}
req.release()
return false
}
Expand Down
8 changes: 8 additions & 0 deletions pkg/kv/kvserver/store_raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ import (
"go.etcd.io/etcd/raft/v3/raftpb"
)

var (
logRaftRecvQueueFullEvery = log.Every(1 * time.Second)
logRaftSendQueueFullEvery = log.Every(1 * time.Second)
)

type raftRequestInfo struct {
req *RaftMessageRequest
respStream RaftMessageResponseStream
Expand Down Expand Up @@ -177,6 +182,9 @@ func (s *Store) HandleRaftUncoalescedRequest(
// TODO(peter): Return an error indicating the request was dropped. Note
// that dropping the request is safe. Raft will retry.
s.metrics.RaftRcvdMsgDropped.Inc(1)
if logRaftRecvQueueFullEvery.ShouldLog() {
log.Warningf(ctx, "raft receive queue for r%d is full", req.RangeID)
}
return false
}
q.infos = append(q.infos, raftRequestInfo{
Expand Down

0 comments on commit 12b7c9d

Please sign in to comment.