pub enum RedexError {
PayloadTooLarge {
size: usize,
max: usize,
},
SegmentOffsetOverflow {
offset: u64,
},
SeqOutOfRange {
seq: u64,
lo: u64,
hi: u64,
},
SeqMismatch {
expected: u64,
actual: u64,
},
Channel(String),
Encode(String),
Decode(String),
Unauthorized,
Io(String),
Closed,
Lagged,
}Expand description
Errors produced by RedEX operations.
Variants§
PayloadTooLarge
Payload is larger than the configured segment supports.
SegmentOffsetOverflow
Segment offset exceeded u32::MAX.
Fires on long-running persistent files whose lifetime heap
bytes have crossed the 4 GB payload_offset field width.
Recoverable by reopening the file; disk recovery resets the
base offset. Sweep-time offset renormalization lands in v2.
SeqOutOfRange
Requested sequence is outside the file’s retained range.
Fields
SeqMismatch
A seq-guarded append (append_batch_if_next_seq) found the
file’s next_seq no longer equal to the caller-supplied
expected_first_seq at the moment the append would run.
#5: replication catch-up validates first_seq == local_next
and then appends; a concurrent writer that advanced
next_seq between the two would misalign the leader↔replica
seqs. The guarded append rejects with this error instead of
silently landing the batch at the wrong seqs. Recoverable —
the caller (replica runtime) re-issues a SYNC_REQUEST from
the new tail.
Fields
Channel(String)
A channel name was rejected (e.g. invalid format, collision on open).
Encode(String)
An encoding helper (e.g. append_postcard) failed to serialize.
Decode(String)
A decode helper (postcard, EventMeta shape, checksum) rejected
a per-event payload. Distinct from Self::Encode so the
fold-error-policy interpreter can treat per-event decode
failures as skip-and-continue even under the Stop policy
— otherwise a single corrupt or attacker-crafted event
could wedge the fold task forever.
Caller is not authorized to append or tail this file.
Io(String)
Underlying I/O failure (disk segment only).
Closed
The file has been closed.
Lagged
A tail subscriber fell behind the per-subscription buffer and was disconnected. Delivery is best-effort: under saturation the buffer may be too full to accept this signal itself, in which case the subscriber observes only a plain stream end.
Implementations§
Source§impl RedexError
impl RedexError
Sourcepub fn io(err: Error) -> RedexError
pub fn io(err: Error) -> RedexError
Construct from any std::io::Error with its message preserved.
Sourcepub fn is_recoverable_decode(&self) -> bool
pub fn is_recoverable_decode(&self) -> bool
Returns true when this error represents a per-event
recoverable failure (a single bad event, NOT an
underlying-storage failure that affects every subsequent
event). The cortex fold-error-policy interpreter treats
these as “always skip-and-continue” even under the Stop
policy — otherwise a single corrupt postcard tail (or a
32-bit checksum collision) would wedge the fold task
permanently and DoS a multi-tenant cortex instance via one
bad event.
Only Decode qualifies — it’s stamped by the cortex fold
implementations specifically on postcard / EventMeta /
checksum failures. Encode is reserved for user-fold-level
errors and storage-side encode failures, which legitimately
halt under Stop. Io / Closed / Lagged are
stream-level. PayloadTooLarge / SegmentOffsetOverflow /
SeqOutOfRange / SeqMismatch / Channel / Unauthorized
are configuration / concurrency / authorization issues.
Trait Implementations§
Source§impl Debug for RedexError
impl Debug for RedexError
Source§impl Display for RedexError
impl Display for RedexError
Source§impl Error for RedexError
impl Error for RedexError
1.30.0 · 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()