chia7712 commented on code in PR #16719:
URL: https://github.com/apache/kafka/pull/16719#discussion_r2646031071
##########
core/src/main/scala/kafka/coordinator/transaction/TransactionLog.scala:
##########
@@ -78,17 +79,16 @@ object TransactionLog {
// Serialize with version 0 (highest non-flexible version) until
transaction.version 1 is enabled
// which enables flexible fields in records.
- val version: Short =
- if (usesFlexibleRecords) 1 else 0
- MessageUtil.toVersionPrefixedBytes(version,
+
MessageUtil.toVersionPrefixedBytes(transactionVersionLevel.transactionLogValueVersion(),
Review Comment:
Apologies for raising a question on this PR.
I noticed that when the TV is downgraded, the broker returns an
`UnsupportedVersionException` to the producer, which seems to put the producer
into a fatal error state.
```
org.apache.kafka.common.KafkaException: Cannot execute transactional
method because we are in an error state
at
app//org.apache.kafka.clients.producer.internals.TransactionManager.maybeFailWithError(TransactionManager.java:1173)
at
app//org.apache.kafka.clients.producer.internals.TransactionManager.lambda$beginAbort$3(TransactionManager.java:366)
at
app//org.apache.kafka.clients.producer.internals.TransactionManager.handleCachedTransactionRequestResult(TransactionManager.java:1282)
at
app//org.apache.kafka.clients.producer.internals.TransactionManager.beginAbort(TransactionManager.java:364)
at
app//org.apache.kafka.clients.producer.KafkaProducer.abortTransaction(KafkaProducer.java:895)
at
app//org.apache.kafka.clients.TransactionsDowngradeTest.test(TransactionsDowngradeTest.java:78)
Caused by:
org.apache.kafka.common.errors.UnsupportedVersionException: The
version of API is not supported.
```
Is the exception above expected?
KIP-890 mentions "If we see a lower MV, we should abort the transaction and
start again with the old protocol."
However, I'm not sure if "start again" implies that the producer application
needs to be restarted (due to the fatal error), or if the producer client
should be able to handle this gracefully
--
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]