Skip to content

Commit 45c8732

Browse files
committed
kvserver: return NodeUnavailable in deferred intent resolution
When batched intent resolution races with a node shutdown, there could be two different outcomes based on the ordering of events: (1) if the node starts quiescing before the start of the intent resolution task, the stopper itself returns `NodeUnavailable`; however, (2) if the intent resolution batch is sent before the quiescing starts, the intent resolver returns a different error (`stopping`). The `NodeUnavailable` error is handled by the `DistSender` and retried at another node, while the custom `stopping` error is returned to the client. When intent resolution is async (e.g. as part of cleaning up after a finalized transaction), the `stopping` error doesn't reach the client. When intent resolution syncrochous (e.g. part of a transaction push), this error can surface to the client, but only in the case of multiple deferred intents; point-key intent resolution takes a shortcut and doesn't use the batcher. This commit brings parity to the error handling for both sides of the race: they both return `NodeUnavailable`, and let the `DistSender` retry. Informs: #64828 Release note: None
1 parent 738c039 commit 45c8732

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/kv/kvserver/intentresolver/intent_resolver.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ func (ir *IntentResolver) resolveIntents(
11181118
case <-ctx.Done():
11191119
return kvpb.NewError(ctx.Err())
11201120
case <-ir.stopper.ShouldQuiesce():
1121-
return kvpb.NewErrorf("stopping")
1121+
return kvpb.NewError(&kvpb.NodeUnavailableError{})
11221122
}
11231123
}
11241124
return nil

0 commit comments

Comments
 (0)