Skip to main content

Module transport

Module transport 

Source
Expand description

Transport seam for the KraftController.

Outbound peer RPCs go through PeerSender, which is real TCP in production and in-memory in tests. Inbound KIP-595 RPCs arrive as Inbound, which carries a oneshot reply channel. Handle-facing requests arrive as Command.

This module is the wire-agnostic boundary: the event loop never touches sockets directly. In-memory tests and real TCP both implement PeerSender against the same command and inbound plumbing.

§Peer codec

Peer RPC request and response bodies are encoded with the generated KIP-595 message codecs in wire. The engine encodes a PeerRequest into the body it hands to PeerSender::send. The receiving transport drives the peer engine and returns a PeerResponse. The sending engine then decodes that response into the matching core Event, which is ReceiveVoteResponse or ReceiveFetchResponse. This keeps the send path fire-and-forget: the engine never .awaits a peer RPC inline.

Re-exports§

pub use self::api_key::PeerApi;

Modules§

api_key
KIP-595 api keys used by the engine’s peer sends.
wire
Real KIP-595 peer-RPC body codec.

Structs§

CommandSender
The sending half of the engine’s mpsc. It stamps each Command with the instant it was sent, before any wait for room in the queue, as Kafka stamps an event when it creates it.
MetadataFetchSlice
A committed-range read result for the observer metadata-fetch path (1004).
NullPeerSender
A no-op PeerSender for single-voter and no-network tests. Every send fails as unreachable.
ObserverReplica
One observer row of DescribeQuorum: a replica the leader has seen fetch that is not a voter, with what the leader tracks for it.
QueuedCommand
A Command on the engine’s mpsc, with the instant it was sent: the start of its Kafka EventQueueTimeMs.
QuorumStateSnapshot
A structured, node-local snapshot of consensus state for the handle, which serves the broker’s DescribeQuorum admin view.

Enums§

Command
Everything that arrives on the engine’s mpsc and drives one turn of the loop.
Inbound
An inbound KIP-595 RPC body, the request version its header carried, and a oneshot to reply on.
TimerTick
Which timer fired. The loop interprets the tick against the current role and liveness state, and does not map it one-to-one to a core event.

Traits§

PeerSender
Outbound peer RPC sender.