Skip to content

Commit

Permalink
Commit registry writes to stable storage to avoid corrupt registry fi…
Browse files Browse the repository at this point in the history
…les (#6877) (#7019)

* fsync contents of registry file to storage

(cherry picked from commit 4d2150d)
  • Loading branch information
Steffen Siering authored and ruflin committed May 7, 2018
1 parent ac4d3b2 commit 25343b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ https://github.com/elastic/beats/compare/v6.0.0-beta2...master[Check the HEAD di
- Fix panic when log prospector configuration fails to load. {issue}6800[6800]
- Fix memory leak in log prospector when files cannot be read. {issue}6797[6797]
- Add raw JSON to message field when JSON parsing fails. {issue}6516[6516]
- Commit registry writes to stable storage to avoid corrupt registry files. {pull}6877[6877]

*Heartbeat*
- Fix race due to updates of shared a map, that was not supposed to be shared between multiple go-routines. {issue}6616[6616]
Expand Down
2 changes: 2 additions & 0 deletions filebeat/registrar/registrar.go
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,8 @@ func (r *Registrar) writeRegistry() error {
return err
}

// Commit the changes to storage to avoid corrupt registry files
f.Sync()
// Directly close file because of windows
f.Close()

Expand Down

0 comments on commit 25343b4

Please sign in to comment.