hachikuji commented on a change in pull request #9838:
URL: https://github.com/apache/kafka/pull/9838#discussion_r554224946



##########
File path: core/src/main/scala/kafka/log/Log.scala
##########
@@ -2124,17 +2130,28 @@ class Log(@volatile private var _dir: File,
           time = time,
           initFileSize = initFileSize,
           preallocate = config.preallocate))
-        updateLogEndOffset(newOffset)
         leaderEpochCache.foreach(_.clearAndFlush())
+        producerStateManager.truncateFullyAndStartAt(newOffset)
 
-        producerStateManager.truncate()
-        producerStateManager.updateMapEndOffset(newOffset)
-        maybeIncrementFirstUnstableOffset()
-        updateLogStartOffset(newOffset)
+        completeTruncation(
+          startOffset = newOffset,
+          endOffset = newOffset
+        )
       }
     }
   }
 
+  private def completeTruncation(
+    startOffset: Long,
+    endOffset: Long,

Review comment:
       Thanks, added by mistake. I will remove it.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to