pub enum ConsensusError {
NotLeader {
observed: Option<Epoch>,
},
Fenced {
expected: Epoch,
current: Epoch,
},
TransientDriver(Box<dyn Error + Send + Sync>),
PermanentDriver(Box<dyn Error + Send + Sync>),
AdvanceOutOfRange(u64),
DenseUnsupported,
SeqKeyCardinalityExceeded {
cap: u64,
},
SeqOverflow,
DenseNotActivated {
required: u8,
active: u8,
},
DenseBatchNotActivated {
required: u8,
active: u8,
},
LeasesUnsupported,
}Expand description
Errors returned by ConsensusDriver operations.
Driver implementations classify their internal failures into one of
TransientDriver or PermanentDriver. The server uses that classification
directly to pick a gRPC status code:
| Variant | gRPC code | Client expectation |
|---|---|---|
NotLeader | FAILED_PRECONDITION + LeaderHint | Retry against the new leader |
Fenced | FAILED_PRECONDITION + LeaderHint | Retry against the new leader |
TransientDriver | UNAVAILABLE | Safe to retry |
PermanentDriver | INTERNAL | Do NOT silently retry |
AdvanceOutOfRange | INTERNAL | Do NOT silently retry |
Variants§
NotLeader
Fenced
TransientDriver(Box<dyn Error + Send + Sync>)
A driver-level failure the caller MAY retry. Use for errors that are reasonably expected to clear on their own: storage I/O hiccup, peer transport flap, transient quorum loss.
PermanentDriver(Box<dyn Error + Send + Sync>)
A driver-level failure the caller MUST NOT silently retry. Use for persistent local fault: read-only filesystem, corruption, gone storage device, bad driver implementation, invariant violation.
AdvanceOutOfRange(u64)
A high-water advance whose physical_ms value exceeds the 46-bit
timestamp layout’s cap. Carries the offending value structurally so
the server can format and route it without downcasting through
Box<dyn Error>. Semantically permanent (a saturated or misconfigured
clock), so the server surfaces it as INTERNAL rather than retrying.
See reject_out_of_range_advance for the propose-time guard.
DenseUnsupported
SeqKeyCardinalityExceeded
SeqOverflow
DenseNotActivated
DenseBatchNotActivated
LeasesUnsupported
Trait Implementations§
Source§impl Debug for ConsensusError
impl Debug for ConsensusError
Source§impl Display for ConsensusError
impl Display for ConsensusError
Source§impl Error for ConsensusError
impl Error for ConsensusError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()