Skip to content

Commit adb3040

Browse files
committed
kvserver: remove bq.replicaCanBeProcessed right before bq.processReplica
Previously, we called bq.replicaCanBeProcessed with acquireLeaseIfNeeded = false before invoking bq.processReplica, which itself calls replicaCanBeProcessed with acquireLeaseIfNeeded = true. This looks incorrect and did not exist prior to c9cf068. It’s unclear how often lease renewal is actually going to be helpful here, but I removed these two calls since they were newly introduced and seem unintentional. Informs: #151292 Release note: none
1 parent 8a15c13 commit adb3040

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

pkg/kv/kvserver/queue.go

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -912,13 +912,6 @@ func (bq *baseQueue) processOneAsyncAndReleaseSem(
912912
) {
913913
ctx = repl.AnnotateCtx(ctx)
914914
taskName := bq.processOpName() + " [outer]"
915-
// Validate that the replica is still in a state that can be processed. If
916-
// it is no longer processable, return immediately.
917-
if _, err := bq.replicaCanBeProcessed(ctx, repl, false /*acquireLeaseIfNeeded */); err != nil {
918-
bq.finishProcessingReplica(ctx, stopper, repl, err)
919-
<-bq.processSem
920-
return
921-
}
922915
if err := stopper.RunAsyncTaskEx(ctx, stop.TaskOpts{TaskName: taskName},
923916
func(ctx context.Context) {
924917
// Release semaphore when finished processing.
@@ -1333,12 +1326,8 @@ func (bq *baseQueue) processReplicasInPurgatory(
13331326
annotatedCtx := repl.AnnotateCtx(ctx)
13341327
if stopper.RunTask(
13351328
annotatedCtx, bq.processOpName(), func(ctx context.Context) {
1336-
if _, err := bq.replicaCanBeProcessed(ctx, repl, false); err != nil {
1337-
bq.finishProcessingReplica(ctx, stopper, repl, err)
1338-
} else {
1339-
err = bq.processReplica(ctx, repl, item.priority /*priorityAtEnqueue*/)
1340-
bq.finishProcessingReplica(ctx, stopper, repl, err)
1341-
}
1329+
err = bq.processReplica(ctx, repl, item.priority /*priorityAtEnqueue*/)
1330+
bq.finishProcessingReplica(ctx, stopper, repl, err)
13421331
},
13431332
) != nil {
13441333
// NB: We do not need to worry about removing any unprocessed replicas

0 commit comments

Comments
 (0)