diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 4d42ea598c5..3af0a2e7f5f 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -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] diff --git a/filebeat/registrar/registrar.go b/filebeat/registrar/registrar.go index 5177b51a32d..0492d07dd73 100644 --- a/filebeat/registrar/registrar.go +++ b/filebeat/registrar/registrar.go @@ -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()