Finalize bufferg

This commit is contained in:
Antonio Andelic 2023-06-02 14:10:52 +00:00
parent 5f625dcdd9
commit 47966c4e81

View File

@ -618,12 +618,14 @@ SnapshotFileInfo KeeperSnapshotManager::serializeSnapshotBufferToDisk(nuraft::bu
auto disk = getLatestSnapshotDisk();
{
disk->writeFile(tmp_snapshot_file_name);
auto buf = disk->writeFile(tmp_snapshot_file_name);
buf->finalize();
}
auto plain_buf = disk->writeFile(snapshot_file_name);
copyData(reader, *plain_buf);
plain_buf->sync();
plain_buf->finalize();
disk->removeFile(tmp_snapshot_file_name);