Skip to content

Commit

Permalink
storage_local: Call fsync for XFS. ref #2373
Browse files Browse the repository at this point in the history
Signed-off-by: Masahiro Nakagawa <repeatedly@gmail.com>
  • Loading branch information
repeatedly committed May 10, 2019
1 parent ba7c201 commit a9a8586
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/fluent/plugin/storage_local.rb
Expand Up @@ -133,7 +133,7 @@ def save
tmp_path = @path + '.tmp'
begin
json_string = Yajl::Encoder.encode(@store, pretty: @pretty_print)
open(tmp_path, 'w:utf-8', @mode){ |io| io.write json_string }
open(tmp_path, 'w:utf-8', @mode) { |io| io.write json_string; io.fsync }
File.rename(tmp_path, @path)
rescue => e
log.error "failed to save data for plugin storage to file", path: @path, tmp: tmp_path, error: e
Expand Down

0 comments on commit a9a8586

Please sign in to comment.