You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by "artemlivshits (via GitHub)" <gi...@apache.org> on 2024/12/19 02:02:15 UTC
Re: [PR] KAFKA-15370: Support Participation in 2PC (KIP-939) (1/N) [kafka]
artemlivshits commented on code in PR #17687:
URL: https://github.com/apache/kafka/pull/17687#discussion_r1890668553
##########
core/src/test/scala/unit/kafka/coordinator/transaction/TransactionMetadataTest.scala:
##########
@@ -231,7 +231,7 @@ class TransactionMetadataTest {
assertEquals(producerId + 1, txnMetadata.producerId)
assertEquals(producerEpoch, txnMetadata.lastProducerEpoch)
assertEquals(0, txnMetadata.producerEpoch)
- assertEquals(1L, txnMetadata.txnStartTimestamp)
+ assertEquals(-1L, txnMetadata.txnStartTimestamp)
Review Comment:
Unconditionally copy data from the transitMetadata when we complete transition.
##########
core/src/test/scala/unit/kafka/coordinator/transaction/TransactionMetadataTest.scala:
##########
@@ -204,7 +204,7 @@ class TransactionMetadataTest {
assertEquals(producerId, txnMetadata.producerId)
assertEquals(producerEpoch + 1, txnMetadata.producerEpoch)
assertEquals(producerEpoch, txnMetadata.lastProducerEpoch)
- assertEquals(1L, txnMetadata.txnStartTimestamp)
+ assertEquals(-1L, txnMetadata.txnStartTimestamp)
Review Comment:
This logic is changed (now we unconditionally copy data from the transitMetadata when we complete transition, so original value of 1 is not preserved), so the unit test is changed to codify the new logic. Looking at the history, it doesn't seem like there was a significance in the logic, it's just the UT codified some behavior, and now it codifies a different behavior.
--
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-unsubscribe@kafka.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org