chia7712 commented on code in PR #21469:
URL: https://github.com/apache/kafka/pull/21469#discussion_r2802672772
##########
core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala:
##########
@@ -1006,6 +1006,9 @@ class TransactionCoordinator(txnConfig: TransactionConfig,
def partitionFor(transactionalId: String): Int =
txnManager.partitionFor(transactionalId)
+ // Package-private for testing
+ private[kafka] def transactionManager: TransactionStateManager = txnManager
Review Comment:
We could make `txnManager` `private[kafka]` instead of adding another getter
##########
transaction-coordinator/src/main/java/org/apache/kafka/coordinator/transaction/TransactionMetadata.java:
##########
@@ -139,11 +139,12 @@ public TxnTransitMetadata prepareNoTransit() {
public TxnTransitMetadata prepareFenceProducerEpoch() {
if (producerEpoch == Short.MAX_VALUE)
- throw new IllegalStateException("Cannot fence producer with epoch
equal to Short.MaxValue since this would overflow");
+ LOGGER.error("Fencing producer {} {} with epoch equal to
Short.MaxValue, this must not happen unless there is a bug", transactionalId,
producerId);
Review Comment:
What action do we expect users to take when they see this message?
##########
core/src/main/scala/kafka/coordinator/transaction/TransactionCoordinator.scala:
##########
@@ -1006,6 +1006,9 @@ class TransactionCoordinator(txnConfig: TransactionConfig,
def partitionFor(transactionalId: String): Int =
txnManager.partitionFor(transactionalId)
+ // Package-private for testing
+ private[kafka] def transactionManager: TransactionStateManager = txnManager
Review Comment:
for example:
```scala
class TransactionCoordinator(txnConfig: TransactionConfig,
scheduler: Scheduler,
createProducerIdManager: () =>
ProducerIdManager,
private[kafka] val txnManager:
TransactionStateManager, // <-- here
txnMarkerChannelManager:
TransactionMarkerChannelManager,
time: Time,
logContext: LogContext)
```
--
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]