[
https://issues.apache.org/jira/browse/KAFKA-20322?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Ritika Reddy updated KAFKA-20322:
---------------------------------
Description:
This bug was introduced from KIP-1228 where a new WriteTxnMarker request
version (v2) was introduced. However, the TransactionMarkerChannelManager still
created its NetworkClient with discoverBrokerVersions=false, which disables API
version negotiation with peer brokers. This causes the transaction coordinator
to blindly send WriteTxnMarkersRequest at the latest supported version, which
fails with UnsupportedVersionException when the target broker is running an
older version that doesn't support that version. Transactions get permanently
stuck in PrepareCommit or PrepareAbort during rolling upgrades.
*ROOT CAUSE:* TransactionMarkerChannelManager creates NetworkClient with
discoverBrokerVersions=false, which disables API version discovery. Without
version discovery, NetworkClient blindly uses the latest API version for all
requests. Discovery should be set to true for compatibility.
*IMPACT:* When a 4.2 broker is the transaction coordinator and needs to write
markers to a 4.1 or earlier broker (partition leader), it sends
WriteTxnMarkersRequest v2, which the older broker doesn't support, causing
UnsupportedVersionException.
*AFFECTED CODE:* origin/trunk:
core/src/main/scala/kafka/coordinator/transaction/TransactionMarkerChannelManager.scala
[https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/coordinator/transaction/TransactionMarkerChannelManager.scala#L98|http://example.com/]
*SOLUTION:* Set version discovery flag to true in the Transaction Marker
Channel Manager
was:
As a part of KIP-1228 we bumped the write transaction request version. With
this change in order for a new coordinator to send a request to an old broker,
discover API versions needed to be set to true to avoid incompatibility.
*ROOT CAUSE:* TransactionMarkerChannelManager creates NetworkClient with
discoverBrokerVersions=false, which disables API version discovery. Without
version discovery, NetworkClient blindly uses the latest API version for all
requests.
*IMPACT:* When a 4.2 broker is the transaction coordinator and needs to write
markers to a 4.1 or earlier broker (partition leader), it sends
WriteTxnMarkersRequest v2, which the older broker doesn't support, causing
UnsupportedVersionException.
*AFFECTED CODE:* origin/trunk:
core/src/main/scala/kafka/coordinator/transaction/TransactionMarkerChannelManager.scala
[https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/coordinator/transaction/TransactionMarkerChannelManager.scala#L98|http://example.com]
*SOLUTION:* Set version discovery flag to true in the Transaction Marker
Channel Manager
> TransactionMarkerChannelManager has discoverBrokerVersions=false causing
> UnsupportedVersionException during rolling upgrades
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: KAFKA-20322
> URL: https://issues.apache.org/jira/browse/KAFKA-20322
> Project: Kafka
> Issue Type: Bug
> Affects Versions: 4.2.0
> Reporter: Ritika Reddy
> Assignee: Ritika Reddy
> Priority: Major
> Fix For: 4.2.1
>
>
> This bug was introduced from KIP-1228 where a new WriteTxnMarker request
> version (v2) was introduced. However, the TransactionMarkerChannelManager
> still created its NetworkClient with discoverBrokerVersions=false, which
> disables API version negotiation with peer brokers. This causes the
> transaction coordinator to blindly send WriteTxnMarkersRequest at the latest
> supported version, which fails with UnsupportedVersionException when the
> target broker is running an older version that doesn't support that version.
> Transactions get permanently stuck in PrepareCommit or PrepareAbort during
> rolling upgrades.
> *ROOT CAUSE:* TransactionMarkerChannelManager creates NetworkClient with
> discoverBrokerVersions=false, which disables API version discovery. Without
> version discovery, NetworkClient blindly uses the latest API version for all
> requests. Discovery should be set to true for compatibility.
> *IMPACT:* When a 4.2 broker is the transaction coordinator and needs to write
> markers to a 4.1 or earlier broker (partition leader), it sends
> WriteTxnMarkersRequest v2, which the older broker doesn't support, causing
> UnsupportedVersionException.
> *AFFECTED CODE:* origin/trunk:
> core/src/main/scala/kafka/coordinator/transaction/TransactionMarkerChannelManager.scala
> [https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/coordinator/transaction/TransactionMarkerChannelManager.scala#L98|http://example.com/]
> *SOLUTION:* Set version discovery flag to true in the Transaction Marker
> Channel Manager
>
--
This message was sent by Atlassian Jira
(v8.20.10#820010)