pub struct ErrorCode(pub i16);Expand description
A broker error code, classified.
This classification is the client. P0 found that a cold cluster answers
FindCoordinator with 15, then 14, then 16 — all of them states of a
healthy cluster rather than failures — so a client that treats a non-zero
code as an error cannot start a transaction at all. The taxonomy is
therefore load-bearing from the first request, not late hardening.
Tuple Fields§
§0: i16Implementations§
Source§impl ErrorCode
impl ErrorCode
pub const NONE: Self
pub const OFFSET_OUT_OF_RANGE: Self
Sourcepub const UNKNOWN_TOPIC_OR_PARTITION: Self
pub const UNKNOWN_TOPIC_OR_PARTITION: Self
The topic or partition is not (yet) known to this broker. Transient while a topic is being auto-created, and part of Kafka’s invalid-metadata family — so it refreshes rather than failing.
pub const LEADER_NOT_AVAILABLE: Self
pub const NOT_LEADER_OR_FOLLOWER: Self
pub const REQUEST_TIMED_OUT: Self
pub const COORDINATOR_LOAD_IN_PROGRESS: Self
pub const COORDINATOR_NOT_AVAILABLE: Self
pub const NOT_COORDINATOR: Self
pub const OUT_OF_ORDER_SEQUENCE_NUMBER: Self
pub const DUPLICATE_SEQUENCE_NUMBER: Self
pub const INVALID_PRODUCER_EPOCH: Self
Sourcepub const CONCURRENT_TRANSACTIONS: Self
pub const CONCURRENT_TRANSACTIONS: Self
The previous transaction’s markers are still being written. Starting a second transaction immediately after ending the first hits this every time — found while writing P1’s broker tests.
pub const PRODUCER_FENCED: Self
pub fn is_ok(self) -> bool
Sourcepub fn disposition(self) -> Disposition
pub fn disposition(self) -> Disposition
How to react.
Unknown codes are Disposition::Fatal on purpose. Guessing “probably
retriable” for a code we have never seen is how a client retries an
operation that already partially succeeded — which, for a producer, is
how records get duplicated.
Trait Implementations§
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
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> 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§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.