What is AddPartitionsToTxn?
Transactional producers send this before writing to any new partition within a transaction to register it with the coordinator. CONCURRENT_TRANSACTIONS means another producer with the same transactional.id is still active and must complete or time out first.
| Version | Kafka | Changes |
|---|---|---|
| AddPartitionsToTxnRequest | ||
| v0 | 2.2 | + Name string+ Partitions []int32+ V3AndBelowTransactionalId string+ V3AndBelowProducerId int64+ V3AndBelowProducerEpoch int16+ V3AndBelowTopics []AddPartitionsToTxnTopic+ Name string+ Partitions []int32 |
| 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 and below will be exclusively used by clients and versions 4 and above will be used by brokers. |
| v4 | 3.5 | + Transactions []AddPartitionsToTxnTransaction+ TransactionalId string+ ProducerId int64+ ProducerEpoch int16+ VerifyOnly bool+ Topics []AddPartitionsToTxnTopic- V3AndBelowTransactionalId string- V3AndBelowProducerId int64- V3AndBelowProducerEpoch int16- V3AndBelowTopics []AddPartitionsToTxnTopicadds VerifyOnly field to check if partitions are already in transaction and adds support to batch multiple transactions. |
| v5 | 3.8 | adds support for new error code TRANSACTION_ABORTABLE (KIP-890). |
| AddPartitionsToTxnResponse | ||
| v0 | 2.2 | + ThrottleTimeMs int32+ Name string+ ResultsByPartition []AddPartitionsToTxnPartitionResult+ PartitionIndex int32+ PartitionErrorCode int16+ ResultsByTopicV3AndBelow []AddPartitionsToTxnTopicResult+ Name string+ ResultsByPartition []AddPartitionsToTxnPartitionResult+ PartitionIndex int32+ PartitionErrorCode 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.5 | + ErrorCode int16+ ResultsByTransaction []AddPartitionsToTxnResult+ TransactionalId string+ TopicResults []AddPartitionsToTxnTopicResult- ResultsByTopicV3AndBelow []AddPartitionsToTxnTopicResultadds support to batch multiple transactions and a top level error code. |
| v5 | 3.8 | adds support for new error code TRANSACTION_ABORTABLE (KIP-890). |