Skip to content

kvserver: mark circuit breaker errors with structured error #74500

@tbg

Description

@tbg

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

Metadata

Metadata

Assignees

Labels

A-kv-replicationRelating to Raft, consensus, and coordination.C-enhancementSolution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions