Skip to main content

EnvironmentFailureReason

Enum EnvironmentFailureReason 

Source
pub enum EnvironmentFailureReason {
Show 20 variants LogChecksum, LogWrite, LogFileNotFound, LogIntegrity, BtreeCorruption, UnexpectedState, UnexpectedStateFatal, UnexpectedException, UnexpectedExceptionFatal, DiskLimit, LatchTimeout, ThreadInterrupted, MasterToReplicaTransition, ReplicaFencing, HandshakeError, ProtocolVersionMismatch, UncaughtException, ForcedShutdown, RecoveryFailure, Other(String),
}
Expand description

Distinguishes the root cause of an EnvironmentFailure.

Callers can match on this to decide whether to attempt restart (invalidates_environment = false) or give up (invalidates_environment = true).

Variants§

§

LogChecksum

A checksum mismatch was detected in the log (persistent corruption). isCorrupted() == true. : LOG_CHECKSUM.

§

LogWrite

A log write I/O error occurred. : LOG_WRITE.

§

LogFileNotFound

A log file was not found during read (truncation or deletion). Mirrors LOG_FILE_NOT_FOUND.

§

LogIntegrity

The log is incomplete or internally inconsistent. Mirrors LOG_INTEGRITY.

§

BtreeCorruption

A persistent B-tree structure inconsistency was detected. isCorrupted() == true. : BTREE_CORRUPTION.

§

UnexpectedState

An unexpected internal state was reached (non-fatal; env still valid). Mirrors UNEXPECTED_STATE.

§

UnexpectedStateFatal

An unexpected internal state was reached (fatal; env is invalidated). Mirrors UNEXPECTED_STATE_FATAL.

§

UnexpectedException

An unexpected exception was caught internally (non-fatal). Mirrors UNEXPECTED_EXCEPTION.

§

UnexpectedExceptionFatal

An unexpected exception was caught internally (fatal; env invalidated). Mirrors UNEXPECTED_EXCEPTION_FATAL.

§

DiskLimit

The disk limit (MAX_DISK) or free-disk threshold (FREE_DISK) was exceeded. : DISK_LIMIT.

§

LatchTimeout

A latch acquisition timed out. : LATCH_TIMEOUT.

§

ThreadInterrupted

The calling thread was interrupted while performing a Mirrors THREAD_INTERRUPTED.

§

MasterToReplicaTransition

The master transitioned to a replica while a transaction was active. Mirrors MASTER_TO_REPLICA_TRANSITION.

§

ReplicaFencing

The replica was fenced by the master. Mirrors REPLICA_FENCING.

§

HandshakeError

A replication handshake error occurred. Mirrors HANDSHAKE_ERROR.

§

ProtocolVersionMismatch

Replication protocol version mismatch. Mirrors PROTOCOL_VERSION_MISMATCH.

§

UncaughtException

An uncaught exception in a background replication thread. Mirrors UNCAUGHT_EXCEPTION.

§

ForcedShutdown

Forced shutdown was requested. Mirrors FORCED_SHUTDOWN.

§

RecoveryFailure

Recovery (WAL replay during environment open) failed.

The v1.5.0 layer surfaced every recovery failure as UnexpectedState, which forced callers to string-match the prefix “recovery failed:” to distinguish it from other unexpected-state errors. This variant is now produced specifically when WAL replay aborts the open path; if invalidates_environment returns true the environment is unusable and a fresh open is required.

§

Other(String)

The specific reason is not mapped to a named variant.

Implementations§

Source§

impl EnvironmentFailureReason

Source

pub fn invalidates_environment(&self) -> bool

Returns true if this reason causes the environment to be invalidated.

After an invalidating failure, all open Environment handles become unusable; they must be closed and re-opened to run recovery.

Mirrors EnvironmentFailureReason.invalidatesEnvironment().

Source

pub fn is_corrupted(&self) -> bool

Returns true if the environment log is persistently corrupted, meaning a network restore or backup restore may be required.

Mirrors EnvironmentFailureException.isCorrupted().

Trait Implementations§

Source§

impl Clone for EnvironmentFailureReason

Source§

fn clone(&self) -> EnvironmentFailureReason

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EnvironmentFailureReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Display for EnvironmentFailureReason

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Eq for EnvironmentFailureReason

Source§

impl PartialEq for EnvironmentFailureReason

Source§

fn eq(&self, other: &EnvironmentFailureReason) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for EnvironmentFailureReason

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more