Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvserver: print old stack in SetPriorityID assertion #78166

Merged
merged 2 commits into from
Mar 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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