From 2cbd96d38a4045dbabb896090bb64ccbc1c633df Mon Sep 17 00:00:00 2001 From: Erik Grinaker Date: Sun, 28 May 2023 20:11:17 +0000 Subject: [PATCH] kvserver: add a few Raft proposal trace events Epic: none Release note: None --- pkg/kv/kvserver/replica_proposal_buf.go | 1 + pkg/kv/kvserver/replica_raft.go | 2 ++ 2 files changed, 3 insertions(+) diff --git a/pkg/kv/kvserver/replica_proposal_buf.go b/pkg/kv/kvserver/replica_proposal_buf.go index 7b6c3dea6169..ea2b874ffdce 100644 --- a/pkg/kv/kvserver/replica_proposal_buf.go +++ b/pkg/kv/kvserver/replica_proposal_buf.go @@ -535,6 +535,7 @@ func (b *propBuf) FlushLockedWithRaftGroup( ents = append(ents, raftpb.Entry{ Data: p.encodedCommand, }) + log.VEvent(p.ctx, 2, "flushing proposal to Raft") } } if firstErr != nil { diff --git a/pkg/kv/kvserver/replica_raft.go b/pkg/kv/kvserver/replica_raft.go index 2877442b01e4..9e17985e4322 100644 --- a/pkg/kv/kvserver/replica_raft.go +++ b/pkg/kv/kvserver/replica_raft.go @@ -269,6 +269,7 @@ func (r *Replica) evalAndPropose( "command is too large: %d bytes (max: %d)", quotaSize, maxSize, )) } + log.VEventf(proposal.ctx, 2, "acquiring proposal quota (%d bytes)", quotaSize) var err error proposal.quotaAlloc, err = r.maybeAcquireProposalQuota(ctx, quotaSize) if err != nil { @@ -501,6 +502,7 @@ func (r *Replica) propose( // // NB: we must not hold r.mu while using the proposal buffer, see comment // on the field. + log.VEvent(p.ctx, 2, "submitting proposal to proposal buffer") err := r.mu.proposalBuf.Insert(ctx, p, tok.Move(ctx)) if err != nil { return kvpb.NewError(err)