Skip to content

Commit 4b58725

Browse files
committed
kvserver: address nits
1 parent e76df7e commit 4b58725

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pkg/kv/kvserver/scheduler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,8 @@ func (ss *raftSchedulerShard) worker(
438438
}
439439

440440
ss.Lock()
441-
if ss.state[id].flags == stateQueued {
441+
state = ss.state[id]
442+
if state.flags == stateQueued {
442443
// No further processing required by the range ID, clear it from the
443444
// state map.
444445
delete(ss.state, id)
@@ -469,7 +470,6 @@ func (ss *raftSchedulerShard) worker(
469470
// can not possibly happen before the current processing is done (i.e.
470471
// now). We do not want the scheduler latency to pick up the time spent
471472
// handling this replica.
472-
state = ss.state[id]
473473
state.begin = crtime.NowMono()
474474
ss.state[id] = state
475475
ss.queue.Push(id)

pkg/kv/kvserver/scheduler_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ func TestSchedulerBuffering(t *testing.T) {
370370
func TestSchedulerEnqueueWhileProcessing(t *testing.T) {
371371
defer leaktest.AfterTest(t)()
372372
defer log.Scope(t).Close(t)
373-
skip.UnderNonTestBuild(t) // stateTestIntercept needs crdb test build
373+
skip.UnderNonTestBuild(t) // stateTestIntercept needs CrdbTestBuild
374374

375375
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
376376
defer cancel()

0 commit comments

Comments
 (0)