Skip to content
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
15 changes: 2 additions & 13 deletions pkg/kv/kvserver/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -912,13 +912,6 @@ func (bq *baseQueue) processOneAsyncAndReleaseSem(
) {
ctx = repl.AnnotateCtx(ctx)
taskName := bq.processOpName() + " [outer]"
// Validate that the replica is still in a state that can be processed. If
// it is no longer processable, return immediately.
if _, err := bq.replicaCanBeProcessed(ctx, repl, false /*acquireLeaseIfNeeded */); err != nil {
bq.finishProcessingReplica(ctx, stopper, repl, err)
<-bq.processSem
return
}
if err := stopper.RunAsyncTaskEx(ctx, stop.TaskOpts{TaskName: taskName},
func(ctx context.Context) {
// Release semaphore when finished processing.
Expand Down Expand Up @@ -1333,12 +1326,8 @@ func (bq *baseQueue) processReplicasInPurgatory(
annotatedCtx := repl.AnnotateCtx(ctx)
if stopper.RunTask(
annotatedCtx, bq.processOpName(), func(ctx context.Context) {
if _, err := bq.replicaCanBeProcessed(ctx, repl, false); err != nil {
bq.finishProcessingReplica(ctx, stopper, repl, err)
} else {
err = bq.processReplica(ctx, repl, item.priority /*priorityAtEnqueue*/)
bq.finishProcessingReplica(ctx, stopper, repl, err)
}
err = bq.processReplica(ctx, repl, item.priority /*priorityAtEnqueue*/)
bq.finishProcessingReplica(ctx, stopper, repl, err)
},
) != nil {
// NB: We do not need to worry about removing any unprocessed replicas
Expand Down