Skip to content

Commit 7d7ee80

Browse files
committed
kvserver: harmonize assertion guard
There was an existing assertion guarded behind util.RaceEnabled; guard the new assertions in the same way. The test still relies on CrdbTestBuild only.
1 parent ecafb7b commit 7d7ee80

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/kv/kvserver/scheduler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ func (ss *raftSchedulerShard) worker(
394394
ss.state[id] = raftScheduleState{flags: stateQueued}
395395
ss.Unlock()
396396

397-
if buildutil.CrdbTestBuild && state.queued == 0 {
397+
if util.RaceEnabled && state.queued == 0 {
398398
// See state.queued for the invariant being checked here.
399399
log.Fatalf(ctx, "raftSchedulerShard.worker called with zero queued: %+v", state)
400400
}
@@ -506,7 +506,7 @@ func (ss *raftSchedulerShard) enqueue1Locked(
506506
if newState.flags&stateQueued == 0 {
507507
newState.flags |= stateQueued
508508
queued++
509-
if buildutil.CrdbTestBuild && newState.queued != 0 {
509+
if util.RaceEnabled && newState.queued != 0 {
510510
// See newState.queued for the invariant being checked here.
511511
log.Fatalf(context.Background(), "raftSchedulerShard.enqueue1Locked called with non-zero queued: %+v", newState)
512512
}

0 commit comments

Comments
 (0)