diff options
-rw-r--r-- | storage/innobase/include/srv0srv.h | 3 | ||||
-rw-r--r-- | storage/innobase/log/log0recv.cc | 23 | ||||
-rw-r--r-- | storage/innobase/srv/srv0start.cc | 5 |
3 files changed, 30 insertions, 1 deletions
diff --git a/storage/innobase/include/srv0srv.h b/storage/innobase/include/srv0srv.h index 6afa1bf7e4e..4704625e1fe 100644 --- a/storage/innobase/include/srv0srv.h +++ b/storage/innobase/include/srv0srv.h @@ -546,7 +546,10 @@ extern my_bool srv_purge_view_update_only_debug; /** Value of MySQL global used to disable master thread. */ extern my_bool srv_master_thread_disabled_debug; +/** InnoDB system tablespace to set during recovery */ extern uint srv_sys_space_size_debug; +/** whether redo log files have been created at startup */ +extern bool srv_log_files_created; #endif /* UNIV_DEBUG */ #define SRV_SEMAPHORE_WAIT_EXTENSION 7200 diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index e48e185274a..71ce7c82a65 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -2806,7 +2806,24 @@ recv_scan_log_recs( scanned_lsn += data_len; + if (data_len == LOG_BLOCK_HDR_SIZE + SIZE_OF_MLOG_CHECKPOINT + && scanned_lsn == checkpoint_lsn + SIZE_OF_MLOG_CHECKPOINT + && log_block[LOG_BLOCK_HDR_SIZE] == MLOG_CHECKPOINT + && checkpoint_lsn == mach_read_from_8(LOG_BLOCK_HDR_SIZE + + 1 + log_block)) { + /* The redo log is logically empty. */ + ut_ad(recv_sys->mlog_checkpoint_lsn == 0 + || recv_sys->mlog_checkpoint_lsn + == checkpoint_lsn); + recv_sys->mlog_checkpoint_lsn = checkpoint_lsn; + DBUG_PRINT("ib_log", ("found empty log; LSN=" LSN_PF, + scanned_lsn)); + finished = true; + break; + } + if (scanned_lsn > recv_sys->scanned_lsn) { + ut_ad(!srv_log_files_created); if (!recv_needed_recovery) { recv_needed_recovery = true; @@ -3244,7 +3261,11 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn) there is something wrong we will print a message to the user about recovery: */ - if (checkpoint_lsn != flush_lsn) { + if (flush_lsn == checkpoint_lsn + SIZE_OF_MLOG_CHECKPOINT + && recv_sys->mlog_checkpoint_lsn == checkpoint_lsn) { + /* The redo log is logically empty. */ + } else if (checkpoint_lsn != flush_lsn) { + ut_ad(!srv_log_files_created); if (checkpoint_lsn + SIZE_OF_MLOG_CHECKPOINT < flush_lsn) { ib::warn() << " Are you sure you are using the" diff --git a/storage/innobase/srv/srv0start.cc b/storage/innobase/srv/srv0start.cc index ee475d43e87..e625ab84334 100644 --- a/storage/innobase/srv/srv0start.cc +++ b/storage/innobase/srv/srv0start.cc @@ -147,6 +147,8 @@ UNIV_INTERN bool srv_undo_sources; #ifdef UNIV_DEBUG /** InnoDB system tablespace to set during recovery */ UNIV_INTERN uint srv_sys_space_size_debug; +/** whether redo log files have been created at startup */ +UNIV_INTERN bool srv_log_files_created; #endif /* UNIV_DEBUG */ /** Bit flags for tracking background thread creation. They are used to @@ -526,6 +528,9 @@ create_log_files_rename( we need to explicitly flush the log buffers. */ fil_flush(SRV_LOG_SPACE_FIRST_ID); + ut_ad(!srv_log_files_created); + ut_d(srv_log_files_created = true); + DBUG_EXECUTE_IF("innodb_log_abort_9", return(DB_ERROR);); DBUG_PRINT("ib_log", ("After innodb_log_abort_9")); |