Commit a0203dc
authored
KAFKA-20322: Add API version discovery true for transaction manager (apache#21782)
[KIP-1228](https://cwiki.apache.org/confluence/display/KAFKA/KIP-1228%3A+Add+Transaction+Version+to+WriteTxnMarkersRequest)
added a WriteTxnMarkersRequest v2 with a TransactionVersion field.
However, TransactionMarkerChannelManager creates its NetworkClient with
discoverBrokerVersions=false, which disables API version negotiation
with peer brokers. Without version discovery, the ApiVersions cache is
never populated — apiVersions.get(nodeId) returns null in
NetworkClient.doSend(), causing it to fall through to
builder.latestAllowedVersion() which blindly uses the highest version
the sending broker knows about rather than negotiating a mutually
supported version. In this fix we enable discovery and also fix the
system test that could've caught this issue earlier. The system test was
run locally and I verified that it failed without the fix and passed
with the fix.
Reviewers: Artem Livshits <alivshits@confluent.io>, David Jacot
<djacot@confluent.io>1 parent a80deda commit a0203dc
3 files changed
Lines changed: 62 additions & 14 deletions
File tree
- core/src
- main/scala/kafka/coordinator/transaction
- test/scala/unit/kafka/coordinator/transaction
- tests/kafkatest/tests/core
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
| |||
Lines changed: 32 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
34 | | - | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
627 | 628 | | |
628 | 629 | | |
629 | 630 | | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
630 | 660 | | |
631 | 661 | | |
632 | 662 | | |
| |||
Lines changed: 29 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
152 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
153 | 164 | | |
154 | 165 | | |
155 | 166 | | |
156 | 167 | | |
157 | | - | |
| 168 | + | |
158 | 169 | | |
159 | 170 | | |
160 | 171 | | |
161 | 172 | | |
162 | 173 | | |
163 | 174 | | |
164 | 175 | | |
165 | | - | |
| 176 | + | |
166 | 177 | | |
167 | 178 | | |
168 | 179 | | |
169 | 180 | | |
170 | 181 | | |
171 | 182 | | |
172 | 183 | | |
173 | | - | |
| 184 | + | |
174 | 185 | | |
175 | 186 | | |
176 | 187 | | |
| |||
179 | 190 | | |
180 | 191 | | |
181 | 192 | | |
182 | | - | |
| 193 | + | |
183 | 194 | | |
184 | | - | |
| 195 | + | |
| 196 | + | |
185 | 197 | | |
186 | | - | |
| 198 | + | |
187 | 199 | | |
188 | 200 | | |
189 | 201 | | |
| |||
193 | 205 | | |
194 | 206 | | |
195 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
196 | 211 | | |
197 | 212 | | |
198 | 213 | | |
| |||
202 | 217 | | |
203 | 218 | | |
204 | 219 | | |
205 | | - | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
206 | 224 | | |
207 | 225 | | |
208 | 226 | | |
| |||
0 commit comments