ccding opened a new pull request #10680:
URL: https://github.com/apache/kafka/pull/10680


   Kafka does not call fsync() on the directory when a new log segment is 
created and flushed to disk.
   
   The problem is that following sequence of calls doesn't guarantee file 
durability:
   
   fd = open("log", O_RDWR | O_CREATE); // suppose open creates "log"
   write(fd);
   fsync(fd);
   
   If the system crashes after fsync() but before the parent directory has been 
flushed to disk, the log file can disappear.
   
   This PR is to flush the directory when flush() is called for the first time.
   
   Did performance test which shows this PR has a minimal performance impact on 
Kafka clusters.
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


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