Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
78166: kvserver: print old stack in SetPriorityID assertion r=erikgrinaker a=tbg

Closes cockroachdb#75939.
    
The issue appears to have been fixed; I've run 100ks of iterations
without a reproduction. Should it ever reproduce, the additional
stack trace should give valuable clues to debug the issue anew.
    
Release note: None


Co-authored-by: Tobias Grieger <[email protected]>
  • Loading branch information
craig[bot] and tbg committed Mar 22, 2022
2 parents 4e7ba29 + 0695b83 commit 5d65d50
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions pkg/kv/kvserver/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"container/list"
"context"
"fmt"
"runtime/debug"
"sync"

"github.com/cockroachdb/cockroach/pkg/roachpb"
Expand Down Expand Up @@ -76,6 +77,7 @@ type rangeIDQueue struct {

// High priority.
priorityID roachpb.RangeID
priorityStack []byte // for debugging in case of assertion failure; see #75939
priorityQueued bool
}

Expand Down Expand Up @@ -121,14 +123,12 @@ func (q *rangeIDQueue) Len() int {
}

func (q *rangeIDQueue) SetPriorityID(id roachpb.RangeID) {
if q.priorityID != 0 && q.priorityID != id &&
// This assertion is temporarily disabled, see:
// https://github.com/cockroachdb/cockroach/issues/75939
false {
if q.priorityID != 0 && q.priorityID != id {
panic(fmt.Sprintf(
"priority range ID already set: old=%d, new=%d",
q.priorityID, id))
"priority range ID already set: old=%d, new=%d, first set at:\n\n%s",
q.priorityID, id, q.priorityStack))
}
q.priorityStack = debug.Stack()
q.priorityID = id
}

Expand Down

0 comments on commit 5d65d50

Please sign in to comment.