Skip to content

Commit

Permalink
Binlog: avoid sync on Binlog creation.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Feb 10, 2023
1 parent 852a164 commit 1c9efb4
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tddb/td/db/binlog/Binlog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -650,8 +650,11 @@ void Binlog::do_reindex() {
});
{
flush();
auto status = fd_.sync_barrier();
LOG_IF(FATAL, status.is_error()) << "Failed to sync binlog: " << status;
if (start_size != 0) { // must sync creation of the file if it is non-empty
auto status = fd_.sync_barrier();
LOG_IF(FATAL, status.is_error()) << "Failed to sync binlog: " << status;
}
need_sync_ = false;
}

// finish_reindex
Expand Down

0 comments on commit 1c9efb4

Please sign in to comment.