pub enum ReplicationError {
Redis {
operation: String,
message: String,
source: Option<RedisError>,
},
CursorStore(Error),
Config(String),
PeerConnection {
peer_id: String,
message: String,
},
Decompression(String),
StreamParse(String),
SyncEngine(String),
InvalidState {
expected: String,
actual: String,
},
Shutdown,
Internal(String),
}Expand description
Errors that can occur during replication.
Each variant includes context about where the error occurred.
Use is_retryable() to check if the operation
should be retried.
Variants§
Redis
Redis connection or command error.
Occurs when communicating with a peer’s Redis instance. These are typically retryable (network timeouts, connection drops).
CursorStore(Error)
SQLite error during cursor persistence.
Occurs when reading/writing cursor positions to SQLite. Not retryable - indicates local database issues that need attention.
Config(String)
Invalid or missing configuration.
Occurs during engine initialization if config is malformed. Not retryable - fix the configuration and restart.
PeerConnection
Peer connection failure.
Occurs when a peer is unreachable or the connection drops. Retryable with exponential backoff.
Decompression(String)
Zstd decompression failure.
Occurs when CDC event payload is corrupted or truncated. Not retryable - the data is corrupt at the source.
StreamParse(String)
CDC stream event parsing failure.
Occurs when a Redis stream entry has unexpected format. Not retryable - the event is malformed at the source.
SyncEngine(String)
Sync engine communication failure.
Occurs when submitting to the local sync engine fails. Retryable - sync engine may be temporarily overloaded.
InvalidState
Engine state machine violation.
Occurs when an operation is attempted in the wrong state
(e.g., calling start() on an already-running engine).
Not retryable - indicates a bug in the caller.
Shutdown
Shutdown in progress.
Returned when operations are attempted during shutdown. Not retryable - engine is terminating.
Internal(String)
Unexpected internal error.
Catch-all for errors that shouldn’t happen. Not retryable - indicates a bug that needs investigation.
Implementations§
Source§impl ReplicationError
impl ReplicationError
Sourcepub fn redis(operation: impl Into<String>, source: RedisError) -> Self
pub fn redis(operation: impl Into<String>, source: RedisError) -> Self
Create a Redis error from a redis::RedisError
Sourcepub fn redis_msg(
operation: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn redis_msg( operation: impl Into<String>, message: impl Into<String>, ) -> Self
Create a Redis error without source
Sourcepub fn is_retryable(&self) -> bool
pub fn is_retryable(&self) -> bool
Check if this error is retryable
Trait Implementations§
Source§impl Debug for ReplicationError
impl Debug for ReplicationError
Source§impl Display for ReplicationError
impl Display for ReplicationError
Source§impl Error for ReplicationError
impl Error for ReplicationError
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
Source§impl From<Error> for ReplicationError
impl From<Error> for ReplicationError
Source§impl From<RedisError> for ReplicationError
impl From<RedisError> for ReplicationError
Source§fn from(e: RedisError) -> Self
fn from(e: RedisError) -> Self
Auto Trait Implementations§
impl Freeze for ReplicationError
impl !RefUnwindSafe for ReplicationError
impl Send for ReplicationError
impl Sync for ReplicationError
impl Unpin for ReplicationError
impl !UnwindSafe for ReplicationError
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
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