Skip to content

Commit 72773d3

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 9bee340 commit 72773d3

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
@@ -905,13 +905,6 @@ func (bq *baseQueue) processOneAsyncAndReleaseSem(
905905
) {
906906
ctx = repl.AnnotateCtx(ctx)
907907
taskName := bq.processOpName() + " [outer]"
908-
// Validate that the replica is still in a state that can be processed. If
909-
// it is no longer processable, return immediately.
910-
if _, err := bq.replicaCanBeProcessed(ctx, repl, false /*acquireLeaseIfNeeded */); err != nil {
911-
bq.finishProcessingReplica(ctx, stopper, repl, err)
912-
<-bq.processSem
913-
return
914-
}
915908
if err := stopper.RunAsyncTaskEx(ctx, stop.TaskOpts{TaskName: taskName},
916909
func(ctx context.Context) {
917910
// Release semaphore when finished processing.
@@ -1312,12 +1305,8 @@ func (bq *baseQueue) processReplicasInPurgatory(
13121305
annotatedCtx := repl.AnnotateCtx(ctx)
13131306
if stopper.RunTask(
13141307
annotatedCtx, bq.processOpName(), func(ctx context.Context) {
1315-
if _, err := bq.replicaCanBeProcessed(ctx, repl, false); err != nil {
1316-
bq.finishProcessingReplica(ctx, stopper, repl, err)
1317-
} else {
1318-
err = bq.processReplica(ctx, repl)
1319-
bq.finishProcessingReplica(ctx, stopper, repl, err)
1320-
}
1308+
err = bq.processReplica(ctx, repl)
1309+
bq.finishProcessingReplica(ctx, stopper, repl, err)
13211310
},
13221311
) != nil {
13231312
// NB: We do not need to worry about removing any unprocessed replicas

0 commit comments

Comments
 (0)