-
Notifications
You must be signed in to change notification settings - Fork 14k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KAFKA-13391: don't fsync directory on Windows OS #11426
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. LGTM
@@ -948,10 +948,12 @@ public static void atomicMoveWithFallback(Path source, Path target, boolean need | |||
/** | |||
* Flushes dirty directories to guarantee crash consistency. | |||
* | |||
* Note: We don't fsync directory on Windows OS because it'll throw AccessDeniedException (KAFKA-13391) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: directory -> directories, because -> because otherwise
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the comment. Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@showuon : Thanks for the PR. LGTM
Reviewers: Cong Ding <cong@ccding.com>, Jun Rao <junrao@gmail.com>
* @throws IOException if flushing the directory fails. | ||
*/ | ||
public static void flushDir(Path path) throws IOException { | ||
if (path != null) { | ||
if (path != null && !OperatingSystem.IS_WINDOWS) { | ||
try (FileChannel dir = FileChannel.open(path, StandardOpenOption.READ)) { | ||
dir.force(true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a file lock on this file that causes the issue, which might be hiding another issue even on other platforms.
Reviewers: Cong Ding <cong@ccding.com>, Jun Rao <junrao@gmail.com>
When will this PR will be released in the 3.0.1/X releases? |
@mosesonline , here's the release plan for v3.0.1. FYI |
Reviewers: Cong Ding <cong@ccding.com>, Jun Rao <junrao@gmail.com>
In #10680, we added
fysnc
on dir to maintain crash consistency. But, it looks like Windows OS doesn't supportfsync
on directory. The same issues also happen on LUCENE and HDFS projects. And the way they fix it is pretty much the same: to skip fsync directory on Windows OS. Here are the patches for both LUCENE-5588 and HDFS-13586.I followed their way to fix this issue. No tests added since it's just an OS check added, no logic change.
Committer Checklist (excluded from commit message)