Skip to content

Commit

Permalink
kv: log on missing store in replicaRLockedStoreLiveness
Browse files Browse the repository at this point in the history
Assists with debugging.

Epic: None
Release note: None
  • Loading branch information
nvanbenschoten committed Oct 22, 2024
1 parent 95a020d commit 6cd574d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/kv/kvserver/replica_store_liveness.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"github.com/cockroachdb/cockroach/pkg/settings"
"github.com/cockroachdb/cockroach/pkg/util/envutil"
"github.com/cockroachdb/cockroach/pkg/util/hlc"
"github.com/cockroachdb/cockroach/pkg/util/log"
)

var raftLeaderFortificationFractionEnabled = settings.RegisterFloatSetting(
Expand Down Expand Up @@ -59,6 +60,8 @@ func (r *replicaRLockedStoreLiveness) getStoreIdent(
func (r *replicaRLockedStoreLiveness) SupportFor(replicaID raftpb.PeerID) (raftpb.Epoch, bool) {
storeID, ok := r.getStoreIdent(replicaID)
if !ok {
ctx := r.AnnotateCtx(context.TODO())
log.Warningf(ctx, "store not found for replica %d in SupportFor", replicaID)
return 0, false
}
// TODO(arul): we can remove this once we start to assign storeLiveness in the
Expand All @@ -76,6 +79,8 @@ func (r *replicaRLockedStoreLiveness) SupportFrom(
) (raftpb.Epoch, hlc.Timestamp) {
storeID, ok := r.getStoreIdent(replicaID)
if !ok {
ctx := r.AnnotateCtx(context.TODO())
log.Warningf(ctx, "store not found for replica %d in SupportFrom", replicaID)
return 0, hlc.Timestamp{}
}
epoch, exp := r.store.storeLiveness.SupportFrom(storeID)
Expand Down

0 comments on commit 6cd574d

Please sign in to comment.