diff --git a/sql/log.cc b/sql/log.cc index 6a59dd1f0628a61e48ba50ae1b7f86accb5e4c9b..4929a6baf0c45161e35eed340cbfcf64dfc0452c 100644 --- a/sql/log.cc +++ b/sql/log.cc @@ -4435,6 +4435,9 @@ bool MYSQL_BIN_LOG::reset_logs(THD *thd, bool create_new_log, mark_xids_active(current_binlog_id, 1); do_checkpoint_request(current_binlog_id); + /* Flush all engine logs to force checkpoint responses to come through. */ + ha_flush_logs(); + /* Now wait for all checkpoint requests and pending unlog() to complete. */ mysql_mutex_lock(&LOCK_xid_list); for (;;) diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 34fc2904cc842fc50fba481ed93fa69fcb0b2d98..666e666700910cb3ffe204bdf4a0e9d05d1eba02 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -1583,7 +1583,7 @@ innobase_start_trx_and_assign_read_view( @return false */ static bool innobase_flush_logs(handlerton*) { - if (!srv_read_only_mode && srv_flush_log_at_trx_commit) + if (!srv_read_only_mode) /* Write any outstanding redo log. Durably if innodb_flush_log_at_trx_commit=1. */ log_buffer_flush_to_disk(srv_flush_log_at_trx_commit == 1);