aboutsummaryrefslogtreecommitdiffhomepage
path: root/tddb/td/db/binlog/Binlog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tddb/td/db/binlog/Binlog.cpp')
-rw-r--r--tddb/td/db/binlog/Binlog.cpp7
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_);