CalvinConfluent commented on code in PR #17698:
URL: https://github.com/apache/kafka/pull/17698#discussion_r1829817069


##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java:
##########
@@ -904,16 +904,22 @@ private void sendProduceRequest(long now, int 
destination, short acks, int timeo
         }
 
         String transactionalId = null;
+        boolean canUseTransactionV2AboveVersion = true;

Review Comment:
   Yeah, I struggled with the naming here. Because here is the produce request 
not transaction specific requests like AddPartitionsToTxn or EndTxn, it 
actually has 3 cases for the produce version:
   1. If it is not transactional, produce version = latest
   2. If it is transactional but v2 disabled, produce version = min(latest, 
LAST_STABLE_VERSION_BEFORE_TRANSACTION_V2)
   3. If it is transactional and v2 enabled, produce version = latest
   So I did not use isTransactionV2Enabled here.



##########
clients/src/main/java/org/apache/kafka/clients/producer/internals/Sender.java:
##########
@@ -904,16 +904,22 @@ private void sendProduceRequest(long now, int 
destination, short acks, int timeo
         }
 
         String transactionalId = null;
+        boolean canUseTransactionV2AboveVersion = true;

Review Comment:
   Yeah, I struggled with the naming here. Because here is the produce request 
not transaction specific requests like AddPartitionsToTxn or EndTxn, it 
actually has 3 cases for the produce version:
   1. If it is not transactional, produce version = latest
   2. If it is transactional but v2 disabled, produce version = min(latest, 
LAST_STABLE_VERSION_BEFORE_TRANSACTION_V2)
   3. If it is transactional and v2 enabled, produce version = latest
   
   So I did not use isTransactionV2Enabled here.



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to