Skip to content

Commit

Permalink
kvserver: downgrade spammy "skipping snapshot" message
Browse files Browse the repository at this point in the history
This message wasn't useful, as it is always logged when a LEARNER upreplication
is occurring. Nothing is lost by moving it behind `V(2)`.

Release note: None
  • Loading branch information
tbg committed Apr 19, 2022
1 parent 9246ff5 commit 31b8f9a
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pkg/kv/kvserver/raft_snapshot_queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ func (rq *raftSnapshotQueue) processRaftSnapshot(
return errors.Errorf("%s: replica %d not present in %v", repl, id, desc.Replicas())
}
snapType := kvserverpb.SnapshotRequest_VIA_SNAPSHOT_QUEUE
skipSnapLogLimiter := log.Every(10 * time.Second)

if typ := repDesc.GetType(); typ == roachpb.LEARNER || typ == roachpb.NON_VOTER {
if fn := repl.store.cfg.TestingKnobs.RaftSnapshotQueueSkipReplica; fn != nil && fn() {
Expand All @@ -125,10 +124,8 @@ func (rq *raftSnapshotQueue) processRaftSnapshot(
typ,
repDesc,
)
if skipSnapLogLimiter.ShouldLog() {
if log.V(2) {
log.Infof(ctx, "%v", err)
} else {
log.VEventf(ctx, 3, "%v", err)
}
// TODO(dan): This is super brittle and non-obvious. In the common case,
// this check avoids duplicate work, but in rare cases, we send the
Expand Down

0 comments on commit 31b8f9a

Please sign in to comment.