Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ public Builder(WriteTxnMarkersRequestData data) {
}

public Builder(final List<TxnMarkerEntry> markers) {
super(ApiKeys.WRITE_TXN_MARKERS, (short) 1); // if we add new versions, gate them behind metadata version
// version will be determined at build time based on broker capabilities
super(ApiKeys.WRITE_TXN_MARKERS);
List<WritableTxnMarker> dataMarkers = new ArrayList<>();
for (TxnMarkerEntry marker : markers) {
final Map<String, WritableTxnMarkerTopic> topicMap = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
// Version 0 was removed in Apache Kafka 4.0, Version 1 is the new baseline.
//
// Version 1 enables flexible versions.
"validVersions": "1",
// Version 2 adds TransactionVersion field to the WritableTxnMarker (KIP-1228).
"validVersions": "1-2",
"flexibleVersions": "1+",
"fields": [
{ "name": "Markers", "type": "[]WritableTxnMarker", "versions": "0+",
Expand All @@ -40,7 +41,9 @@
"about": "The indexes of the partitions to write transaction markers for." }
]},
{ "name": "CoordinatorEpoch", "type": "int32", "versions": "0+",
"about": "Epoch associated with the transaction state partition hosted by this transaction coordinator." }
"about": "Epoch associated with the transaction state partition hosted by this transaction coordinator." },
{ "name": "TransactionVersion", "type": "int8", "versions": "2+", "ignorable": true,
"about": "Transaction version of the marker. Ex: 0/1 = legacy (TV0/TV1), 2 = TV2 etc.", "default": "0" }
]}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
"apiKey": 27,
"type": "response",
"name": "WriteTxnMarkersResponse",
"validVersions": "1",
"validVersions": "1-2",
// Version 0 was removed in Apache Kafka 4.0, Version 1 is the new baseline.
//
// Version 1 enables flexible versions.
// Version 2 matches WriteTxnMarkersRequest version 2 (KIP-1228).
"flexibleVersions": "1+",
"fields": [
{ "name": "Markers", "type": "[]WritableTxnMarkerResult", "versions": "0+",
Expand Down