chia7712 commented on code in PR #23316:
URL: https://github.com/apache/kafka/pull/23316#discussion_r3992688515


##########
storage/src/main/java/org/apache/kafka/storage/internals/log/AbstractIndex.java:
##########
@@ -252,12 +241,15 @@ public void renameTo(File f) throws IOException {
     }
 
     /**
-     * Flush the data in the index to disk
+     * Flush the data in the index and its metadata to disk
      */
-    public void flush() {
+    public void flush() throws IOException {
         inLock(() -> {
             if (mmap != null) {
                 mmap.force();
+                try (FileChannel channel = FileChannel.open(file.toPath(), 
StandardOpenOption.WRITE)) {

Review Comment:
   It's interesting. flushDir() has a Windows-related condition to avoid 
flushing with READ permission. I'm not sure what the current state of Windows 
support is, but maybe we should start a discussion about deprecating it.
   Anyway, I've opened https://issues.apache.org/jira/browse/KAFKA-21075 to 
handle Utils.flushFileIfExists​ 



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