...
1// AddPartitionsToTxnRequest begins the producer side of a transaction for all
2// partitions in the request. Before producing any records to a partition in
3// the transaction, that partition must have been added to the transaction with
4// this request.
5//
6// Versions 3 and below are exclusively used by clients and versions 4 and
7// above are used by brokers.
8//
9// Version 4 adds VerifyOnly field to check if partitions are already in
10// transaction and adds support to batch multiple transactions.
11AddPartitionsToTxnRequest => key 24, max version 4, flexible v3+, txn coordinator
12 // TransactionalID is the transactional ID to use for this request.
13 TransactionalID: string // v0-v3
14 // ProducerID is the producer ID of the client for this transactional ID
15 // as received from InitProducerID.
16 ProducerID: int64 // v0-v3
17 // ProducerEpoch is the producer epoch of the client for this transactional ID
18 // as received from InitProducerID.
19 ProducerEpoch: int16 // v0-v3
20 // Topics are topics to add as part of the producer side of a transaction.
21 Topics: [=>] // v0-v3
22 // Topic is a topic name.
23 Topic: string
24 // Partitions are partitions within a topic to add as part of the producer
25 // side of a transaction.
26 Partitions: [int32]
27 // The list of transactions to add partitions to, for v4+, for brokers only.
28 // The fields in this are batch broker requests that duplicate the above fields
29 // and thus are undocumented (except VerifyOnly, which is new).
30 Transactions: [=>] // v4+
31 TransactionalID: string
32 ProducerID: int64
33 ProducerEpoch: int16
34 // VerifyOnly signifies if we want to check if the partition is in the
35 // transaction rather than add it.
36 VerifyOnly: bool
37 Topics: [=>]
38 Topic: string
39 Partitions: [int32]
40
41// AddPartitionsToTxnResponse is a response to an AddPartitionsToTxnRequest.
42AddPartitionsToTxnResponse =>
43 ThrottleMillis(1)
44 // The response top level error code.
45 ErrorCode: int16 // v4+
46 // Results categorized by transactional ID, v4+ only, for brokers only.
47 // The fields duplicate v3 and below fields (except TransactionalID) and
48 // are left undocumented.
49 Transactions: [=>] // v4+
50 // The transactional id corresponding to the transaction.
51 TransactionalID: string
52 Topics: [=>]
53 Topic: string
54 Partitions: [=>]
55 Partition: int32
56 ErrorCode: int16
57 // Topics are responses to topics in the request.
58 Topics: [=>] // v0-v3
59 // Topic is a topic being responded to.
60 Topic: string
61 // Partitions are responses to partitions in the request.
62 Partitions: [=>]
63 // Partition is a partition being responded to.
64 Partition: int32
65 // ErrorCode is any error for this topic/partition commit.
66 //
67 // TRANSACTIONAL_ID_AUTHORIZATION_FAILED is returned if the client is
68 // not authorized for write with transactional IDs with the requested
69 // transactional ID.
70 //
71 // TOPIC_AUTHORIZATION_FAILED is returned for all topics that the client
72 // is not authorized to write to.
73 //
74 // UNKNOWN_TOPIC_OR_PARTITION is returned for all topics or partitions
75 // that the broker does not know of.
76 //
77 // OPERATION_NOT_ATTEMPTED is returned if any of the above errors occur
78 // for all partitions that did not have the above errors.
79 //
80 // INVALID_REQUEST is returned if the transactional ID is invalid.
81 //
82 // COORDINATOR_LOAD_IN_PROGRESS is returned if the coordinator for this
83 // transactional ID is still loading.
84 //
85 // NOT_COORDINATOR is returned if the broker is not the coordinator for
86 // this transactional ID.
87 //
88 // INVALID_PRODUCER_ID_MAPPING is returned if the produce request used
89 // a producer ID that is not tied to the transactional ID (i.e., mismatch
90 // from what was returned from InitProducerID).
91 //
92 // INVALID_PRODUCER_EPOCH is returned if the requested epoch does not match
93 // the broker epoch for this transactional ID.
94 //
95 // CONCURRENT_TRANSACTIONS is returned if there is an ongoing transaction for
96 // this transactional ID, if the producer ID and epoch matches the broker's.
97 ErrorCode: int16
View as plain text