-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Fix corrupt Winlogbeat registry occurring on power failure #2434
Conversation
File writes are cached and not immediately flushed to disk. So if there is a power loss prior to flushing it seems that some corruption occurs. This adds the FILE_FLAG_WRITE_THROUGH flag to the CreateFile call to ensure that writes go directly to the disk.
@andrewkroh I assume the same could happen in filebeat? Should we apply the same patch there (or finally extract the registry writing part)? |
…2546) File writes are cached and not immediately flushed to disk. So if there is a power loss prior to flushing it seems that some corruption occurs. This adds the FILE_FLAG_WRITE_THROUGH flag to the CreateFile call to ensure that writes go directly to the disk.
@ruflin Sorry for not responding to you sooner 😆 . Yeah, I think we should apply the same patch to Filebeat. It would most likely help with #3537 (comment) on Windows. |
The part changed in this PR is mainly about writing files. Short term winlogbeat and filebeat should both use this method to write files. Long term it would be nice to have the complete registry standardised. To have a quick fix (which I think we need) we can to a PR against Filebeat with this and generalised it later. |
@ruflin ++ agreed. |
) (elastic#2546) File writes are cached and not immediately flushed to disk. So if there is a power loss prior to flushing it seems that some corruption occurs. This adds the FILE_FLAG_WRITE_THROUGH flag to the CreateFile call to ensure that writes go directly to the disk.
File writes are cached and not immediately flushed to disk. So if there is a power loss prior to flushing it seems that some corruption occurs. This adds the FILE_FLAG_WRITE_THROUGH flag to the CreateFile call to ensure that writes go directly to the disk on Windows.