hubcio commented on code in PR #3223:
URL: https://github.com/apache/iggy/pull/3223#discussion_r3218472978
##########
core/binary_protocol/src/consensus/header.rs:
##########
@@ -303,6 +308,188 @@ impl ConsensusHeader for ReplyHeader {
}
}
+// EvictionReason, wire-level reason in EvictionHeader.
+//
+// Discriminants pinned: any reorder/reuse breaks SDK decoders. New
+// variants also break old SDKs (CheckedBitPattern fails). Coordinate
+// SDK releases on every extension.
+
+/// Wire reason on [`EvictionHeader`]. Session-terminal; never transient.
+/// No `Default`: callers must name reason so `..default()` can't ship
+/// `Reserved`.
+///
+/// **Wire-version pinned.**
+#[derive(Debug, Clone, Copy, PartialEq, Eq, NoUninit, CheckedBitPattern)]
+#[repr(u8)]
+pub enum EvictionReason {
+ /// Sentinel; rejected on wire.
+ Reserved = 0,
+
+ /// No session for `client_id`.
+ NoSession = 1,
+ /// Client release < cluster min.
+ ClientReleaseTooLow = 2,
+ /// Client release > cluster max.
+ ClientReleaseTooHigh = 3,
+ /// Invalid operation discriminant.
+ InvalidRequestOperation = 4,
+ /// Body failed state-machine validation.
+ InvalidRequestBody = 5,
Review Comment:
I think it depends on command. if command is malformed (i.e. deserialization
fails) then we actually disconnect clients.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]