pub fn control_batch_image_records(
batch: &RecordBatch,
) -> Result<Vec<MetadataRecord>, MetadataReplayError>Expand description
The image records one committed control batch carries, in log order: each
KIP-853 KRaftVersionRecord as a V1KRaftVersion and each VotersRecord
as a V1Voters.
The KIP-595 LeaderChange marker and the snapshot framing records change no
image, so they yield nothing, and so does a batch that is not a control
batch.
A controller folds these into its image when it commits them. A broker-only observer reads only committed records, and folds them in as it reads them, so its image names the same voters, and the endpoints that reach them.
ยงErrors
MetadataReplayError::InvalidControlRecord for a control record that
does not decode, or that names a kraft.version or voter set Kafka would
refuse, as restart recovery refuses it. Kafka halts on such a record on
every role.