diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index f90a7390993..7fade671e93 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -3860,7 +3860,9 @@ static bool xtrabackup_backup_low() if (recv_find_max_checkpoint(&max_cp_field) == DB_SUCCESS && log_sys.log.format != 0) { if (max_cp_field == LOG_CHECKPOINT_1) { - log_header_read(max_cp_field); + log_sys.log.read(max_cp_field, + {log_sys.checkpoint_buf, + OS_FILE_LOG_BLOCK_SIZE}); } metadata_to_lsn = mach_read_from_8( log_sys.checkpoint_buf + LOG_CHECKPOINT_LSN); @@ -4067,11 +4069,11 @@ reread_log_header: goto fail; } - const byte* buf = log_sys.checkpoint_buf; + byte* buf = log_sys.checkpoint_buf; checkpoint_lsn_start = log_sys.log.get_lsn(); checkpoint_no_start = log_sys.next_checkpoint_no; - log_header_read(max_cp_field); + log_sys.log.read(max_cp_field, {buf, OS_FILE_LOG_BLOCK_SIZE}); if (checkpoint_no_start != mach_read_from_8(buf + LOG_CHECKPOINT_NO) || checkpoint_lsn_start diff --git a/storage/innobase/include/log0log.h b/storage/innobase/include/log0log.h index a484f04666a..e8aead05af5 100644 --- a/storage/innobase/include/log0log.h +++ b/storage/innobase/include/log0log.h @@ -211,9 +211,6 @@ shutdown. This function also writes all log in log file to the log archive. */ void logs_empty_and_mark_files_at_shutdown(void); /*=======================================*/ -/** Read a log group header page to log_sys.checkpoint_buf. -@param[in] header 0 or LOG_CHECKPOINT_1 or LOG_CHECKPOINT2 */ -void log_header_read(ulint header); /** Write checkpoint info to the log header and invoke log_mutex_exit(). @param[in] end_lsn start LSN of the FILE_CHECKPOINT mini-transaction */ void log_write_checkpoint_info(lsn_t end_lsn); diff --git a/storage/innobase/log/log0log.cc b/storage/innobase/log/log0log.cc index b63ea201ffb..945cf520a8d 100644 --- a/storage/innobase/log/log0log.cc +++ b/storage/innobase/log/log0log.cc @@ -1340,20 +1340,6 @@ static bool log_preflush_pool_modified_pages(lsn_t new_oldest) return(success); } -/** Read a log group header page to log_sys.checkpoint_buf. -@param[in] header 0 or LOG_CHECKPOINT_1 or LOG_CHECKPOINT2 */ -void log_header_read(ulint header) -{ - ut_ad(log_mutex_own()); - - log_sys.n_log_ios++; - - MONITOR_INC(MONITOR_LOG_IO); - - log_sys.log.read(header, - {log_sys.checkpoint_buf, OS_FILE_LOG_BLOCK_SIZE}); -} - /** Write checkpoint info to the log header and invoke log_mutex_exit(). @param[in] end_lsn start LSN of the FILE_CHECKPOINT mini-transaction */ void log_write_checkpoint_info(lsn_t end_lsn) diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc index faf2ea72324..e3d5cdb42c4 100644 --- a/storage/innobase/log/log0recv.cc +++ b/storage/innobase/log/log0recv.cc @@ -1353,7 +1353,7 @@ recv_find_max_checkpoint_0(ulint* max_field) for (ulint field = LOG_CHECKPOINT_1; field <= LOG_CHECKPOINT_2; field += LOG_CHECKPOINT_2 - LOG_CHECKPOINT_1) { - log_header_read(field); + log_sys.log.read(field, {buf, OS_FILE_LOG_BLOCK_SIZE}); if (static_cast(ut_fold_binary(buf, CHECKSUM_1)) != mach_read_from_4(buf + CHECKSUM_1) @@ -1552,7 +1552,7 @@ recv_find_max_checkpoint(ulint* max_field) buf = log_sys.checkpoint_buf; - log_header_read(0); + log_sys.log.read(0, {buf, OS_FILE_LOG_BLOCK_SIZE}); /* Check the header page checksum. There was no checksum in the first redo log format (version 0). */ log_sys.log.format = mach_read_from_4(buf + LOG_HEADER_FORMAT); @@ -1591,8 +1591,7 @@ recv_find_max_checkpoint(ulint* max_field) for (field = LOG_CHECKPOINT_1; field <= LOG_CHECKPOINT_2; field += LOG_CHECKPOINT_2 - LOG_CHECKPOINT_1) { - - log_header_read(field); + log_sys.log.read(field, {buf, OS_FILE_LOG_BLOCK_SIZE}); const ulint crc32 = log_block_calc_checksum_crc32(buf); const ulint cksum = log_block_get_checksum(buf); @@ -3306,9 +3305,8 @@ recv_recovery_from_checkpoint_start(lsn_t flush_lsn) return(err); } - log_header_read(max_cp_field); - buf = log_sys.checkpoint_buf; + log_sys.log.read(max_cp_field, {buf, OS_FILE_LOG_BLOCK_SIZE}); checkpoint_lsn = mach_read_from_8(buf + LOG_CHECKPOINT_LSN); checkpoint_no = mach_read_from_8(buf + LOG_CHECKPOINT_NO);