diff --git a/lib/fluent/plugin/storage_local.rb b/lib/fluent/plugin/storage_local.rb index 1ae0c6cd54..d17022fe6b 100644 --- a/lib/fluent/plugin/storage_local.rb +++ b/lib/fluent/plugin/storage_local.rb @@ -130,7 +130,7 @@ def load def save return if @on_memory - tmp_path = @path + '.tmp' + tmp_path = @path + '.tmp.' + Fluent::UniqueId.hex(Fluent::UniqueId.generate) begin json_string = Yajl::Encoder.encode(@store, pretty: @pretty_print) File.open(tmp_path, 'w:utf-8', @mode) { |io| io.write json_string; io.fsync }