From cc8f5e1c0ad1e46b75a223cba4c73f17a069ff84 Mon Sep 17 00:00:00 2001 From: Andrei Matei Date: Wed, 9 Sep 2020 18:40:04 -0400 Subject: [PATCH] log stack on not comp --- pkg/kv/kvserver/replica_init.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkg/kv/kvserver/replica_init.go b/pkg/kv/kvserver/replica_init.go index 3fa7215e547e..81d077c87895 100644 --- a/pkg/kv/kvserver/replica_init.go +++ b/pkg/kv/kvserver/replica_init.go @@ -12,7 +12,9 @@ package kvserver import ( "context" + "fmt" "math/rand" + "runtime/debug" "time" "github.com/cockroachdb/cockroach/pkg/kv/kvserver/abortspan" @@ -313,7 +315,12 @@ func (r *Replica) setDescLockedRaftMuLocked(ctx context.Context, desc *roachpb.R r.connectionClass.set(rpc.ConnectionClassForKey(desc.StartKey)) r.concMgr.OnRangeDescUpdated(desc) if desc.IsInitialized() { - log.Infof(ctx, "!!! updating r.Desc to: %s", desc) + var msg string + if !desc.GetGenerationComparable() { + stack := string(debug.Stack()) + msg = fmt.Sprintf("not comparable: (%p)\n%s", desc.GenerationComparable, stack) + } + log.Infof(ctx, "!!! updating r.Desc to: %s %s", desc, msg) } r.mu.state.Desc = desc }