What is EndTxn?
Commits or aborts a transaction (committed=true or false). If a producer crashes without calling EndTxn, the transaction coordinator aborts it after transaction.timeout.ms, blocking read_committed consumers on that partition until the abort marker is written.
| Version | Kafka | Changes |
|---|---|---|
| EndTxnRequest | ||
| v0 | 2.2 | + TransactionalId string+ ProducerId int64+ ProducerEpoch int16+ Committed bool |
| v1 | 2.2 | is the same as version 0. |
| v2 | 2.7 | adds the support for new error code PRODUCER_FENCED. |
| v3 | 2.8 | ~ Flexible encoding enabled FLEXIBLE enables flexible versions. |
| v4 | 3.8 | adds support for new error code TRANSACTION_ABORTABLE (KIP-890). |
| v5 | 4.0 | enables bumping epoch on every transaction (KIP-890 Part 2) |
| EndTxnResponse | ||
| v0 | 2.2 | + ThrottleTimeMs int32+ ErrorCode int16 |
| v1 | 2.2 | on quota violation, brokers send out responses before throttling. |
| v2 | 2.7 | adds the support for new error code PRODUCER_FENCED. |
| v3 | 2.8 | ~ Flexible encoding enabled FLEXIBLE enables flexible versions. |
| v4 | 3.8 | adds support for new error code TRANSACTION_ABORTABLE (KIP-890). |
| v5 | 4.0 | + ProducerId int64+ ProducerEpoch int16enables bumping epoch on every transaction (KIP-890 Part 2), so producer ID and epoch are included in the response. |