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
impl EnvironmentFailureReason
Sourcepub fn invalidates_environment(&self) -> bool
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().
Sourcepub fn is_corrupted(&self) -> bool
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
impl Clone for EnvironmentFailureReason
Source§fn clone(&self) -> EnvironmentFailureReason
fn clone(&self) -> EnvironmentFailureReason
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for EnvironmentFailureReason
impl Debug for EnvironmentFailureReason
Source§impl Display for EnvironmentFailureReason
impl Display for EnvironmentFailureReason
impl Eq for EnvironmentFailureReason
Source§impl PartialEq for EnvironmentFailureReason
impl PartialEq for EnvironmentFailureReason
Source§fn eq(&self, other: &EnvironmentFailureReason) -> bool
fn eq(&self, other: &EnvironmentFailureReason) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for EnvironmentFailureReason
Auto Trait Implementations§
impl Freeze for EnvironmentFailureReason
impl RefUnwindSafe for EnvironmentFailureReason
impl Send for EnvironmentFailureReason
impl Sync for EnvironmentFailureReason
impl Unpin for EnvironmentFailureReason
impl UnsafeUnpin for EnvironmentFailureReason
impl UnwindSafe for EnvironmentFailureReason
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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