Skip to content
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

Merged
merged 1 commit into from
Sep 2, 2016

Conversation

andrewkroh
Copy link
Member

@andrewkroh andrewkroh commented Sep 1, 2016

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.

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
Copy link
Contributor

ruflin commented Sep 2, 2016

@andrewkroh I assume the same could happen in filebeat? Should we apply the same patch there (or finally extract the registry writing part)?

@andrewkroh andrewkroh added the needs_backport PR is waiting to be backported to other branches. label Sep 14, 2016
andrewkroh added a commit to andrewkroh/beats that referenced this pull request Sep 14, 2016
)

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 andrewkroh removed the needs_backport PR is waiting to be backported to other branches. label Sep 14, 2016
tsg pushed a commit that referenced this pull request Sep 14, 2016
…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.
@andrewkroh andrewkroh deleted the bugfix/winlogbeat-registry branch September 16, 2016 18:46
@andrewkroh
Copy link
Member Author

andrewkroh commented Mar 8, 2018

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

@ruflin
Copy link
Contributor

ruflin commented Mar 11, 2018

Oh, my comment was fire and forget it seems :-( Perhaps a good time to "merge" the file writing? @urso @ph ?

@ph
Copy link
Contributor

ph commented Mar 22, 2018

@ruflin
What do you actually mean by:
"merge" the file writing

  1. Port this PR to filebeat
  2. Merge @urso optimization to the registry?

@ruflin
Copy link
Contributor

ruflin commented Mar 22, 2018

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.

@ph
Copy link
Contributor

ph commented Mar 22, 2018

@ruflin ++ agreed.

leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
) (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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants