pub enum ConsensusError {
NotLeader {
observed: Option<Epoch>,
},
Fenced {
expected: Epoch,
current: Epoch,
},
TransientDriver(Box<dyn Error + Send + Sync>),
PermanentDriver(Box<dyn Error + Send + Sync>),
}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 |
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.
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)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for ConsensusError
impl !RefUnwindSafe for ConsensusError
impl Send for ConsensusError
impl Sync for ConsensusError
impl Unpin for ConsensusError
impl UnsafeUnpin for ConsensusError
impl !UnwindSafe for ConsensusError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more