Add missing sync of underlying files

This commit is contained in:
Azat Khuzhin 2021-02-13 13:15:36 +03:00
parent fa329808e5
commit 06e8065ee6
4 changed files with 5 additions and 0 deletions

View File

@ -562,6 +562,7 @@ void debugIncreaseOOMScore()
{
DB::WriteBufferFromFile buf("/proc/self/oom_score_adj");
buf.write(new_score.c_str(), new_score.size());
buf.close();
}
catch (const Poco::Exception & e)
{

View File

@ -217,6 +217,7 @@ namespace
/// Write the file.
WriteBufferFromFile out{tmp_file_path.string()};
out.write(file_contents.data(), file_contents.size());
out.close();
/// Rename.
std::filesystem::rename(tmp_file_path, file_path);
@ -274,6 +275,7 @@ namespace
writeStringBinary(name, out);
writeUUIDText(id, out);
}
out.close();
}

View File

@ -50,6 +50,7 @@ struct Test
{
DB::WriteBufferFromFile wb(filename);
wb.write(reinterpret_cast<const char *>(&store), sizeof(store));
wb.close();
}
{

View File

@ -97,6 +97,7 @@ void run(String part_path, String date_column, String dest_path)
Poco::File(new_tmp_part_path_str + "checksums.txt").setWriteable();
WriteBufferFromFile checksums_out(new_tmp_part_path_str + "checksums.txt", 4096);
checksums.write(checksums_out);
checksums.close();
Poco::File(new_tmp_part_path).renameTo(new_part_path.toString());
}