Skip to content

Commit

Permalink
kvserver: use r-prefix for range IDs in quiescence logs
Browse files Browse the repository at this point in the history
Epic: none
Release note: None
  • Loading branch information
erikgrinaker committed Jun 20, 2023
1 parent 50d7264 commit 3dd1a37
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/kv/kvserver/replica_raft_quiesce.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ var raftDisableQuiescence = envutil.EnvOrDefaultBool("COCKROACH_DISABLE_QUIESCEN
func (r *Replica) quiesceLocked(ctx context.Context, lagging laggingReplicaSet) {
if !r.mu.quiescent {
if log.V(3) {
log.Infof(ctx, "quiescing %d", r.RangeID)
log.Infof(ctx, "quiescing r%d", r.RangeID)
}
r.mu.quiescent = true
r.mu.laggingFollowersOnQuiesce = lagging
r.store.unquiescedReplicas.Lock()
delete(r.store.unquiescedReplicas.m, r.RangeID)
r.store.unquiescedReplicas.Unlock()
} else if log.V(4) {
log.Infof(ctx, "already quiesced")
log.Infof(ctx, "r%d already quiesced", r.RangeID)
}
}

Expand Down Expand Up @@ -78,7 +78,7 @@ func (r *Replica) maybeUnquiesceLocked(wakeLeader, mayCampaign bool) bool {
}
ctx := r.AnnotateCtx(context.TODO())
if log.V(3) {
log.Infof(ctx, "unquiescing %d", r.RangeID)
log.Infof(ctx, "unquiescing r%d", r.RangeID)
}
r.mu.quiescent = false
r.mu.laggingFollowersOnQuiesce = nil
Expand All @@ -94,7 +94,7 @@ func (r *Replica) maybeUnquiesceLocked(wakeLeader, mayCampaign bool) bool {
} else if st.RaftState == raft.StateFollower && wakeLeader {
// Propose an empty command which will wake the leader.
if log.V(3) {
log.Infof(ctx, "waking %d leader", r.RangeID)
log.Infof(ctx, "waking r%d leader", r.RangeID)
}
data := raftlog.EncodeRaftCommand(raftlog.EntryEncodingStandardWithoutAC, makeIDKey(), nil)
_ = r.mu.internalRaftGroup.Propose(data)
Expand Down

0 comments on commit 3dd1a37

Please sign in to comment.