novosibman commented on code in PR #13782:
URL: https://github.com/apache/kafka/pull/13782#discussion_r1223374923


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/ProducerStateManager.java:
##########
@@ -681,7 +687,12 @@ private static void writeSnapshot(File file, Map<Long, 
ProducerStateEntry> entri
 
         try (FileChannel fileChannel = FileChannel.open(file.toPath(), 
StandardOpenOption.CREATE, StandardOpenOption.WRITE)) {
             fileChannel.write(buffer);
-            fileChannel.force(true);
+        }
+
+        if (scheduler != null) {
+            scheduler.scheduleOnce("flush-producer-snapshot", () -> 
Utils.flushFileQuietly(file.toPath(), "producer-snapshot"));
+        } else {
+            Utils.flushFileQuietly(file.toPath(), "producer-snapshot");

Review Comment:
   Open/close changes done



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

Reply via email to