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 (elastic#6877)

* fsync contents of registry file to storage
  • Loading branch information
kvch authored and andrewkroh committed Apr 26, 2018
1 parent b0f9406 commit 6babaae
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 @@ -65,6 +65,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 6babaae

Please sign in to comment.