ijuma commented on code in PR #18267:
URL: https://github.com/apache/kafka/pull/18267#discussion_r1894582099


##########
core/src/main/scala/kafka/server/ReplicaManager.scala:
##########
@@ -2046,7 +2046,7 @@ class ReplicaManager(val config: KafkaConfig,
 
   def getLogConfig(topicPartition: TopicPartition): Option[LogConfig] = 
localLog(topicPartition).map(_.config)
 
-  def getMagic(topicPartition: TopicPartition): Option[Byte] = 
getLogConfig(topicPartition).map(_.recordVersion.value)
+  def getMagic(topicPartition: TopicPartition): Option[Byte] = 
getLogConfig(topicPartition).map(_ => RecordVersion.V2.value)

Review Comment:
   Do we still need this method?



##########
coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorRuntime.java:
##########
@@ -857,14 +858,13 @@ private void maybeAllocateNewBatch(
         ) {
             if (currentBatch == null) {
                 LogConfig logConfig = partitionWriter.config(tp);
-                byte magic = logConfig.recordVersion().value;
                 int maxBatchSize = logConfig.maxMessageSize();
                 long prevLastWrittenOffset = coordinator.lastWrittenOffset();
                 ByteBuffer buffer = bufferSupplier.get(maxBatchSize);
 
                 MemoryRecordsBuilder builder = new MemoryRecordsBuilder(
                     buffer,
-                    magic,
+                    RecordVersion.V2.value,

Review Comment:
   Perhaps use `RecordBatch.CURRENT_MAGIC_VALUE` here and other similar places.



-- 
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]

Reply via email to