Shekharrajak opened a new pull request, #22703:
URL: https://github.com/apache/kafka/pull/22703

    Ref https://issues.apache.org/jira/browse/KAFKA-20738
   
   A producer with transaction.two.phase.commit.enable=true fails 
initTransactions() with UnsupportedVersionException: Attempted to write a 
non-default enable2Pc at version 5.
   
   Root cause:  v6 is latestVersionUnstable, the builder caps  
latestAllowedVersion at 5, so NetworkClient can never negotiate v6.
   
   Fix: When enable2Pc or keepPreparedTxn is set, the builder allows the 
unstable last version (v6) so v6 is negotiated against a capable broker. Plain 
producers are unaffected (still  capped at v5). build() now throws a clear 
UnsupportedVersionException if the negotiated version is < 6 while a 2PC field 
is set, instead of leaking the serialization-internals  message.
   
   Tests: Added InitProducerIdRequestTest covering latestAllowedVersion == 6 
when enable2Pc/keepPreparedTxn is set, and the v5 cap for non-2PC requests.
   
   Note: this is the client-side half; broker-side keepPreparedTxn recovery is 
tracked in KAFKA-20739.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to