From 88ce9e96debf598bb43f7cb60736172aaef64ab0 Mon Sep 17 00:00:00 2001 From: Travis Bischel Date: Thu, 10 Oct 2024 19:50:56 -0600 Subject: [PATCH] kip-890 definitions A bunch of version bumps to indicate TransactionAbortable is supported as an error return. --- generate/definitions/00_produce | 2 +- generate/definitions/10_find_coordinator | 2 +- generate/definitions/22_init_producer_id | 2 +- generate/definitions/24_add_partitions_to_txn | 2 +- generate/definitions/25_add_offsets_to_txn | 2 +- generate/definitions/26_end_txn | 2 +- generate/definitions/28_txn_offset_commit | 2 +- pkg/kmsg/generated.go | 28 +++++++++---------- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/generate/definitions/00_produce b/generate/definitions/00_produce index 4afd2651..4addcd2a 100644 --- a/generate/definitions/00_produce +++ b/generate/definitions/00_produce @@ -6,7 +6,7 @@ // Note that the special client ID "__admin_client" will allow you to produce // records to internal topics. This is generally recommended if you want to // break your Kafka cluster. -ProduceRequest => key 0, max version 10, flexible v9+ +ProduceRequest => key 0, max version 11, flexible v9+ // TransactionID is the transaction ID to use for this request, allowing for // exactly once semantics. TransactionID: nullable-string // v3+ diff --git a/generate/definitions/10_find_coordinator b/generate/definitions/10_find_coordinator index 5c5d8cdd..238f2a87 100644 --- a/generate/definitions/10_find_coordinator +++ b/generate/definitions/10_find_coordinator @@ -3,7 +3,7 @@ // This coordinator is different from the broker leader coordinator. This // coordinator is the partition leader for the partition that is storing // the group or transaction ID. -FindCoordinatorRequest => key 10, max version 4, flexible v3+ +FindCoordinatorRequest => key 10, max version 5, flexible v3+ // CoordinatorKey is the ID to use for finding the coordinator. For groups, // this is the group name, for transactional producer, this is the // transactional ID. diff --git a/generate/definitions/22_init_producer_id b/generate/definitions/22_init_producer_id index 2afbf188..18df2313 100644 --- a/generate/definitions/22_init_producer_id +++ b/generate/definitions/22_init_producer_id @@ -4,7 +4,7 @@ // // Note that you do not need to go to a txn coordinator if you are initializing // a producer id without a transactional id. -InitProducerIDRequest => key 22, max version 4, flexible v2+, txn coordinator +InitProducerIDRequest => key 22, max version 5, flexible v2+, txn coordinator // TransactionalID is the ID to use for transactions if using transactions. TransactionalID: nullable-string // TransactionTimeoutMillis is how long a transaction is allowed before diff --git a/generate/definitions/24_add_partitions_to_txn b/generate/definitions/24_add_partitions_to_txn index dc8b757b..355f2803 100644 --- a/generate/definitions/24_add_partitions_to_txn +++ b/generate/definitions/24_add_partitions_to_txn @@ -8,7 +8,7 @@ // // Version 4 adds VerifyOnly field to check if partitions are already in // transaction and adds support to batch multiple transactions. -AddPartitionsToTxnRequest => key 24, max version 4, flexible v3+, txn coordinator +AddPartitionsToTxnRequest => key 24, max version 5, flexible v3+, txn coordinator // TransactionalID is the transactional ID to use for this request. TransactionalID: string // v0-v3 // ProducerID is the producer ID of the client for this transactional ID diff --git a/generate/definitions/25_add_offsets_to_txn b/generate/definitions/25_add_offsets_to_txn index bd52bcac..a7750a3b 100644 --- a/generate/definitions/25_add_offsets_to_txn +++ b/generate/definitions/25_add_offsets_to_txn @@ -6,7 +6,7 @@ // Internally, this request simply adds the __consumer_offsets topic as a // partition for this transaction with AddPartitionsToTxn for the partition // in that topic that contains the group. -AddOffsetsToTxnRequest => key 25, max version 3, flexible v3+, txn coordinator +AddOffsetsToTxnRequest => key 25, max version 4, flexible v3+, txn coordinator // TransactionalID is the transactional ID to use for this request. TransactionalID: string // ProducerID is the producer ID of the client for this transactional ID diff --git a/generate/definitions/26_end_txn b/generate/definitions/26_end_txn index 6b569817..d571b03f 100644 --- a/generate/definitions/26_end_txn +++ b/generate/definitions/26_end_txn @@ -1,6 +1,6 @@ // EndTxnRequest ends a transaction. This should be called after // TxnOffsetCommitRequest. -EndTxnRequest => key 26, max version 3, flexible v3+, txn coordinator +EndTxnRequest => key 26, max version 4, flexible v3+, txn coordinator // TransactionalID is the transactional ID to use for this request. TransactionalID: string // ProducerID is the producer ID of the client for this transactional ID diff --git a/generate/definitions/28_txn_offset_commit b/generate/definitions/28_txn_offset_commit index 73186821..bbf743dd 100644 --- a/generate/definitions/28_txn_offset_commit +++ b/generate/definitions/28_txn_offset_commit @@ -1,7 +1,7 @@ // TxnOffsetCommitRequest sends offsets that are a part of this transaction // to be committed once the transaction itself finishes. This effectively // replaces OffsetCommitRequest for when using transactions. -TxnOffsetCommitRequest => key 28, max version 3, flexible v3+, group coordinator +TxnOffsetCommitRequest => key 28, max version 4, flexible v3+, group coordinator // TransactionalID is the transactional ID to use for this request. TransactionalID: string // Group is the group consumed in this transaction and to be used for diff --git a/pkg/kmsg/generated.go b/pkg/kmsg/generated.go index 75bff995..583a8dc9 100644 --- a/pkg/kmsg/generated.go +++ b/pkg/kmsg/generated.go @@ -2783,7 +2783,7 @@ type ProduceRequest struct { } func (*ProduceRequest) Key() int16 { return 0 } -func (*ProduceRequest) MaxVersion() int16 { return 10 } +func (*ProduceRequest) MaxVersion() int16 { return 11 } func (v *ProduceRequest) SetVersion(version int16) { v.Version = version } func (v *ProduceRequest) GetVersion() int16 { return v.Version } func (v *ProduceRequest) IsFlexible() bool { return v.Version >= 9 } @@ -3306,7 +3306,7 @@ type ProduceResponse struct { } func (*ProduceResponse) Key() int16 { return 0 } -func (*ProduceResponse) MaxVersion() int16 { return 10 } +func (*ProduceResponse) MaxVersion() int16 { return 11 } func (v *ProduceResponse) SetVersion(version int16) { v.Version = version } func (v *ProduceResponse) GetVersion() int16 { return v.Version } func (v *ProduceResponse) IsFlexible() bool { return v.Version >= 9 } @@ -12493,7 +12493,7 @@ type FindCoordinatorRequest struct { } func (*FindCoordinatorRequest) Key() int16 { return 10 } -func (*FindCoordinatorRequest) MaxVersion() int16 { return 4 } +func (*FindCoordinatorRequest) MaxVersion() int16 { return 5 } func (v *FindCoordinatorRequest) SetVersion(version int16) { v.Version = version } func (v *FindCoordinatorRequest) GetVersion() int16 { return v.Version } func (v *FindCoordinatorRequest) IsFlexible() bool { return v.Version >= 3 } @@ -12733,7 +12733,7 @@ type FindCoordinatorResponse struct { } func (*FindCoordinatorResponse) Key() int16 { return 10 } -func (*FindCoordinatorResponse) MaxVersion() int16 { return 4 } +func (*FindCoordinatorResponse) MaxVersion() int16 { return 5 } func (v *FindCoordinatorResponse) SetVersion(version int16) { v.Version = version } func (v *FindCoordinatorResponse) GetVersion() int16 { return v.Version } func (v *FindCoordinatorResponse) IsFlexible() bool { return v.Version >= 3 } @@ -19348,7 +19348,7 @@ type InitProducerIDRequest struct { } func (*InitProducerIDRequest) Key() int16 { return 22 } -func (*InitProducerIDRequest) MaxVersion() int16 { return 4 } +func (*InitProducerIDRequest) MaxVersion() int16 { return 5 } func (v *InitProducerIDRequest) SetVersion(version int16) { v.Version = version } func (v *InitProducerIDRequest) GetVersion() int16 { return v.Version } func (v *InitProducerIDRequest) IsFlexible() bool { return v.Version >= 2 } @@ -19523,7 +19523,7 @@ type InitProducerIDResponse struct { } func (*InitProducerIDResponse) Key() int16 { return 22 } -func (*InitProducerIDResponse) MaxVersion() int16 { return 4 } +func (*InitProducerIDResponse) MaxVersion() int16 { return 5 } func (v *InitProducerIDResponse) SetVersion(version int16) { v.Version = version } func (v *InitProducerIDResponse) GetVersion() int16 { return v.Version } func (v *InitProducerIDResponse) IsFlexible() bool { return v.Version >= 2 } @@ -20367,7 +20367,7 @@ type AddPartitionsToTxnRequest struct { } func (*AddPartitionsToTxnRequest) Key() int16 { return 24 } -func (*AddPartitionsToTxnRequest) MaxVersion() int16 { return 4 } +func (*AddPartitionsToTxnRequest) MaxVersion() int16 { return 5 } func (v *AddPartitionsToTxnRequest) SetVersion(version int16) { v.Version = version } func (v *AddPartitionsToTxnRequest) GetVersion() int16 { return v.Version } func (v *AddPartitionsToTxnRequest) IsFlexible() bool { return v.Version >= 3 } @@ -20953,7 +20953,7 @@ type AddPartitionsToTxnResponse struct { } func (*AddPartitionsToTxnResponse) Key() int16 { return 24 } -func (*AddPartitionsToTxnResponse) MaxVersion() int16 { return 4 } +func (*AddPartitionsToTxnResponse) MaxVersion() int16 { return 5 } func (v *AddPartitionsToTxnResponse) SetVersion(version int16) { v.Version = version } func (v *AddPartitionsToTxnResponse) GetVersion() int16 { return v.Version } func (v *AddPartitionsToTxnResponse) IsFlexible() bool { return v.Version >= 3 } @@ -21388,7 +21388,7 @@ type AddOffsetsToTxnRequest struct { } func (*AddOffsetsToTxnRequest) Key() int16 { return 25 } -func (*AddOffsetsToTxnRequest) MaxVersion() int16 { return 3 } +func (*AddOffsetsToTxnRequest) MaxVersion() int16 { return 4 } func (v *AddOffsetsToTxnRequest) SetVersion(version int16) { v.Version = version } func (v *AddOffsetsToTxnRequest) GetVersion() int16 { return v.Version } func (v *AddOffsetsToTxnRequest) IsFlexible() bool { return v.Version >= 3 } @@ -21559,7 +21559,7 @@ type AddOffsetsToTxnResponse struct { } func (*AddOffsetsToTxnResponse) Key() int16 { return 25 } -func (*AddOffsetsToTxnResponse) MaxVersion() int16 { return 3 } +func (*AddOffsetsToTxnResponse) MaxVersion() int16 { return 4 } func (v *AddOffsetsToTxnResponse) SetVersion(version int16) { v.Version = version } func (v *AddOffsetsToTxnResponse) GetVersion() int16 { return v.Version } func (v *AddOffsetsToTxnResponse) IsFlexible() bool { return v.Version >= 3 } @@ -21668,7 +21668,7 @@ type EndTxnRequest struct { } func (*EndTxnRequest) Key() int16 { return 26 } -func (*EndTxnRequest) MaxVersion() int16 { return 3 } +func (*EndTxnRequest) MaxVersion() int16 { return 4 } func (v *EndTxnRequest) SetVersion(version int16) { v.Version = version } func (v *EndTxnRequest) GetVersion() int16 { return v.Version } func (v *EndTxnRequest) IsFlexible() bool { return v.Version >= 3 } @@ -21832,7 +21832,7 @@ type EndTxnResponse struct { } func (*EndTxnResponse) Key() int16 { return 26 } -func (*EndTxnResponse) MaxVersion() int16 { return 3 } +func (*EndTxnResponse) MaxVersion() int16 { return 4 } func (v *EndTxnResponse) SetVersion(version int16) { v.Version = version } func (v *EndTxnResponse) GetVersion() int16 { return v.Version } func (v *EndTxnResponse) IsFlexible() bool { return v.Version >= 3 } @@ -22678,7 +22678,7 @@ type TxnOffsetCommitRequest struct { } func (*TxnOffsetCommitRequest) Key() int16 { return 28 } -func (*TxnOffsetCommitRequest) MaxVersion() int16 { return 3 } +func (*TxnOffsetCommitRequest) MaxVersion() int16 { return 4 } func (v *TxnOffsetCommitRequest) SetVersion(version int16) { v.Version = version } func (v *TxnOffsetCommitRequest) GetVersion() int16 { return v.Version } func (v *TxnOffsetCommitRequest) IsFlexible() bool { return v.Version >= 3 } @@ -23143,7 +23143,7 @@ type TxnOffsetCommitResponse struct { } func (*TxnOffsetCommitResponse) Key() int16 { return 28 } -func (*TxnOffsetCommitResponse) MaxVersion() int16 { return 3 } +func (*TxnOffsetCommitResponse) MaxVersion() int16 { return 4 } func (v *TxnOffsetCommitResponse) SetVersion(version int16) { v.Version = version } func (v *TxnOffsetCommitResponse) GetVersion() int16 { return v.Version } func (v *TxnOffsetCommitResponse) IsFlexible() bool { return v.Version >= 3 }