diff options
| author | Arseny Smirnov <arseny30@gmail.com> | 2023-02-10 12:17:50 +0100 |
|---|---|---|
| committer | Arseny Smirnov <arseny30@gmail.com> | 2023-02-10 12:17:56 +0100 |
| commit | 8df048c0d211c7a9d0ef63f7ccc76ddda57e8ccf (patch) | |
| tree | d45253b25d09b839f72c97d94eb0ddb1b69017f6 /tddb | |
| parent | a0dd1e1a074dd5751a49c45aa87b89eb8ea0e03d (diff) | |
Use FileFd::sync_barrier in Binlog
Diffstat (limited to 'tddb')
| -rw-r--r-- | tddb/td/db/binlog/Binlog.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tddb/td/db/binlog/Binlog.cpp b/tddb/td/db/binlog/Binlog.cpp index 70c2a4676..410f5b0e7 100644 --- a/tddb/td/db/binlog/Binlog.cpp +++ b/tddb/td/db/binlog/Binlog.cpp @@ -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_); |
