Skip to content

Commit

Permalink
log stack on not comp
Browse files Browse the repository at this point in the history
  • Loading branch information
andreimatei committed Sep 9, 2020
1 parent 26e1a73 commit cc8f5e1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/kv/kvserver/replica_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ package kvserver

import (
"context"
"fmt"
"math/rand"
"runtime/debug"
"time"

"github.com/cockroachdb/cockroach/pkg/kv/kvserver/abortspan"
Expand Down Expand Up @@ -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
}

0 comments on commit cc8f5e1

Please sign in to comment.