jolshan commented on code in PR #15964: URL: https://github.com/apache/kafka/pull/15964#discussion_r1603801460
########## group-coordinator/src/main/java/org/apache/kafka/coordinator/group/runtime/CoordinatorRuntime.java: ########## @@ -723,30 +757,66 @@ public void run() { // If the records are not empty, first, they are applied to the state machine, // second, then are written to the partition/log, and finally, the response // is put into the deferred event queue. + long prevLastWrittenOffset = context.coordinator.lastWrittenOffset(); + LogConfig logConfig = partitionWriter.config(tp); + byte magic = logConfig.recordVersion().value; + int maxBatchSize = logConfig.maxMessageSize(); + long currentTimeMs = time.milliseconds(); + ByteBuffer buffer = context.bufferSupplier.get(Math.min(16384, maxBatchSize)); + try { - // Apply the records to the state machine. - if (result.replayRecords()) { - // We compute the offset of the record based on the last written offset. The - // coordinator is the single writer to the underlying partition so we can - // deduce it like this. - for (int i = 0; i < result.records().size(); i++) { + MemoryRecordsBuilder builder = MemoryRecords.builder( Review Comment: nit: is there a benefit from putting this here and not right before the append method? -- 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-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org