mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-04 05:22:17 +00:00
Add finalize calls
This commit is contained in:
parent
a9eb2c3c4e
commit
e8442b7a88
@ -43,7 +43,8 @@ void moveFileBetweenDisks(DiskPtr disk_from, ChangelogFileDescriptionPtr descrip
|
|||||||
auto from_path = fs::path(description->path);
|
auto from_path = fs::path(description->path);
|
||||||
auto tmp_changelog_name = from_path.parent_path() / (std::string{tmp_prefix} + from_path.filename().string());
|
auto tmp_changelog_name = from_path.parent_path() / (std::string{tmp_prefix} + from_path.filename().string());
|
||||||
{
|
{
|
||||||
disk_to->writeFile(tmp_changelog_name);
|
auto buf = disk_to->writeFile(tmp_changelog_name);
|
||||||
|
buf->finalize();
|
||||||
}
|
}
|
||||||
disk_from->copyFile(from_path, *disk_to, path_to, {});
|
disk_from->copyFile(from_path, *disk_to, path_to, {});
|
||||||
disk_to->removeFile(tmp_changelog_name);
|
disk_to->removeFile(tmp_changelog_name);
|
||||||
@ -342,10 +343,16 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (log_file_settings.compress_logs)
|
if (log_file_settings.compress_logs)
|
||||||
|
{
|
||||||
compressed_buffer.reset();
|
compressed_buffer.reset();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
chassert(file_buf);
|
||||||
|
file_buf->finalize();
|
||||||
file_buf.reset();
|
file_buf.reset();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
WriteBuffer & getBuffer()
|
WriteBuffer & getBuffer()
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,8 @@ namespace
|
|||||||
auto from_path = fs::path(path_from);
|
auto from_path = fs::path(path_from);
|
||||||
auto tmp_snapshot_name = from_path.parent_path() / (std::string{tmp_prefix} + from_path.filename().string());
|
auto tmp_snapshot_name = from_path.parent_path() / (std::string{tmp_prefix} + from_path.filename().string());
|
||||||
{
|
{
|
||||||
disk_to->writeFile(tmp_snapshot_name);
|
auto buf = disk_to->writeFile(tmp_snapshot_name);
|
||||||
|
buf->finalize();
|
||||||
}
|
}
|
||||||
disk_from->copyFile(from_path, *disk_to, path_to, {});
|
disk_from->copyFile(from_path, *disk_to, path_to, {});
|
||||||
disk_to->removeFile(tmp_snapshot_name);
|
disk_to->removeFile(tmp_snapshot_name);
|
||||||
@ -784,7 +785,8 @@ SnapshotFileInfo KeeperSnapshotManager::serializeSnapshotToDisk(const KeeperStor
|
|||||||
|
|
||||||
auto disk = getLatestSnapshotDisk();
|
auto disk = getLatestSnapshotDisk();
|
||||||
{
|
{
|
||||||
disk->writeFile(tmp_snapshot_file_name);
|
auto buf = disk->writeFile(tmp_snapshot_file_name);
|
||||||
|
buf->finalize();
|
||||||
}
|
}
|
||||||
|
|
||||||
auto writer = disk->writeFile(snapshot_file_name);
|
auto writer = disk->writeFile(snapshot_file_name);
|
||||||
|
Loading…
Reference in New Issue
Block a user