-
Notifications
You must be signed in to change notification settings - Fork 4.1k
kvserver: mark circuit breaker errors with structured error #74500
Description
Part of #33007.
Can be done after #71806 lands.
Introduce a structured error (say roachpb.ReplicaUnavailableError) that is guaranteed to be a mark on any error returned from (*replicaCircuitBreaker).Signal().Err(). We could achieve this most simply in (*replicaCircuitBreaker).Report, by adding an err = errors.Mark(err, &ReplicaUnavailableError{...}), but this strategy does not allow information from the request to be included in the structured error. This is what we want though - to print the most user-helpful error, we want to point out the specific access that landed on an unavailable Replica. It would be less helpful to only point out that Replica's bounds. So what we may want to do instead is to defer some code in Replica.Send that intercepts outgoing breaker errors and marks them with the structured error.
Jira issue: CRDB-12118