mimaison commented on code in PR #18201:
URL: https://github.com/apache/kafka/pull/18201#discussion_r1940016513
##########
core/src/main/scala/kafka/coordinator/transaction/TransactionStateManager.scala:
##########
@@ -37,14 +38,17 @@ import org.apache.kafka.common.{KafkaException,
TopicPartition}
import org.apache.kafka.coordinator.transaction.{TransactionLogConfig,
TransactionStateManagerConfig}
import org.apache.kafka.server.common.{RequestLocal, TransactionVersion}
import org.apache.kafka.server.config.ServerConfigs
-import org.apache.kafka.server.record.BrokerCompressionType
import org.apache.kafka.server.storage.log.FetchIsolation
import org.apache.kafka.server.util.Scheduler
import org.apache.kafka.storage.internals.log.AppendOrigin
import scala.jdk.CollectionConverters._
import scala.collection.mutable
+object TransactionStateManager {
+ val EnforcedCompression: Compression = Compression.NONE
+ private val EnforcedRequiredAcks: Short = -1.toShort
Review Comment:
Should we also use this field in `KafkaApis.handleWriteTxnMarkersRequest()`?
##########
core/src/main/scala/kafka/coordinator/transaction/TransactionStateManager.scala:
##########
@@ -400,12 +404,20 @@ class TransactionStateManager(brokerId: Int,
def validateTransactionTimeoutMs(txnTimeoutMs: Int): Boolean =
txnTimeoutMs <= config.transactionMaxTimeoutMs && txnTimeoutMs > 0
+ /**
+ * Enforce always using:
+ * <br>1. cleanup policy = compact
+ * <br>2. compression = none
+ * <br>3. unclean leader election = disabled
+ * <br>4. required acks = -1 when writing
Review Comment:
Not sure why mention `acks` here since it's not related to the topic
configurations.
Also _if we really need a list_, we can use an HTML list instead of line
returns
##########
core/src/main/scala/kafka/coordinator/transaction/TransactionStateManager.scala:
##########
@@ -45,6 +46,15 @@ import org.apache.kafka.storage.internals.log.AppendOrigin
import scala.jdk.CollectionConverters._
import scala.collection.mutable
+object TransactionStateManager {
+ // enforce always using
+ // 1. cleanup policy = compact
+ // 2. compression = none
+ // 3. unclean leader election = disabled
+ // 4. required acks = -1 when writing
+ val EnforcedCompression: Compression = Compression.NONE
Review Comment:
I'm not sure this is the best place to store these values. Have you
considered `TransactionCoordinator`? I'm not saying it should go there, just
asking.
--
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]