Skip to main content

BARRIER_CONTROL_TYPE

Constant BARRIER_CONTROL_TYPE 

Source
pub const BARRIER_CONTROL_TYPE: i16 = 1000;
Expand description

Control-record type of a krabka barrier marker.

Kafka assigns the control-record types 0 to 6: ABORT, COMMIT, LEADER_CHANGE, SNAPSHOT_HEADER, SNAPSHOT_FOOTER, KRAFT_VERSION, and VOTERS. The value 1000 starts a krabka-private range that Kafka cannot reach by normal growth. krabka-raft uses the same convention for its private api keys at 1003 and 1004.

A barrier marker is a control batch with one record. The record key holds this type. The batch sets producer_id to -1, it sets producer_epoch to -1, and it clears the transactional attribute bit. The log keeps no transaction state and no producer state for such a batch. Kafka’s ControlRecordType.parse reports an unknown type for the value 1000 and skips the batch, so a JVM consumer never sees the record.

The broker builds the marker batch and the log classifies it. Both read this one constant.