diff --git a/core/src/main/scala/kafka/coordinator/transaction/TransactionLog.scala b/core/src/main/scala/kafka/coordinator/transaction/TransactionLog.scala index 17e640ebb33..829e9e6bf65 100644 --- a/core/src/main/scala/kafka/coordinator/transaction/TransactionLog.scala +++ b/core/src/main/scala/kafka/coordinator/transaction/TransactionLog.scala @@ -281,7 +281,7 @@ object TransactionLog { case Some(txnMetadata) => s"producerId:${txnMetadata.producerId}," + s"producerEpoch:${txnMetadata.producerEpoch}," + s"state=${txnMetadata.state}," + - s"partitions=${txnMetadata.topicPartitions}," + + s"partitions=${txnMetadata.topicPartitions.mkString("[", ",", "]")}," + s"txnLastUpdateTimestamp=${txnMetadata.txnLastUpdateTimestamp}," + s"txnTimeoutMs=${txnMetadata.txnTimeoutMs}" } diff --git a/core/src/test/scala/unit/kafka/coordinator/transaction/TransactionLogTest.scala b/core/src/test/scala/unit/kafka/coordinator/transaction/TransactionLogTest.scala index e9bf6d51454..e9bdf3110a8 100644 --- a/core/src/test/scala/unit/kafka/coordinator/transaction/TransactionLogTest.scala +++ b/core/src/test/scala/unit/kafka/coordinator/transaction/TransactionLogTest.scala @@ -123,7 +123,7 @@ class TransactionLogTest { val (keyStringOpt, valueStringOpt) = TransactionLog.formatRecordKeyAndValue(transactionMetadataRecord) assertEquals(Some(s"transaction_metadata::transactionalId=$transactionalId"), keyStringOpt) assertEquals(Some(s"producerId:$producerId,producerEpoch:$producerEpoch,state=Ongoing," + - s"partitions=Set($topicPartition),txnLastUpdateTimestamp=0,txnTimeoutMs=$transactionTimeoutMs"), valueStringOpt) + s"partitions=[$topicPartition],txnLastUpdateTimestamp=0,txnTimeoutMs=$transactionTimeoutMs"), valueStringOpt) } @Test