Use FileFd::sync_barrier in Binlog

This commit is contained in:
Arseny Smirnov 2023-02-10 12:17:50 +01:00
parent a0dd1e1a07
commit 8df048c0d2
1 changed files with 5 additions and 2 deletions

View File

@ -648,8 +648,11 @@ void Binlog::do_reindex() {
processor_->for_each([&](BinlogEvent &event) {
do_event(std::move(event)); // NB: no move is actually happens
});
need_sync_ = start_size != 0; // must sync creation of the file if it is non-empty
sync();
{
flush();
auto status = fd_.sync_barrier();
LOG_IF(FATAL, status.is_error()) << "Failed to sync binlog: " << status;
}
// finish_reindex
auto status = unlink(path_);