From caa8c20abee29416c82031a8ae2f7dd23d821b10 Mon Sep 17 00:00:00 2001 From: Vlad Lesin Date: Mon, 8 Apr 2019 15:08:04 +0300 Subject: MDEV-14192 Mariabackup assertion failure: byte_offset % OS_FILE_LOG_BLOCK_SIZE == 0 xtrabackup_backup_func(): If the log checkpoint header changed since we last read it, search for the most recent checkpoint again. Otherwise, we could corrupt the backup of the redo log, because the least significant bits of checkpoint_lsn_start would not match log_sys->log.lsn. --- extra/mariabackup/xtrabackup.cc | 31 +++++++++++-------------------- 1 file changed, 11 insertions(+), 20 deletions(-) (limited to 'extra') diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index b8c87f09ec1..3eca4687bbd 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -4003,9 +4003,7 @@ static bool xtrabackup_backup_low() /** Implement --backup @return whether the operation succeeded */ -static -bool -xtrabackup_backup_func() +static bool xtrabackup_backup_func() { MY_STAT stat_info; uint i; @@ -4175,38 +4173,25 @@ fail: log_mutex_enter(); +reread_log_header: dberr_t err = recv_find_max_checkpoint(&max_cp_field); if (err != DB_SUCCESS) { -log_fail: + msg("Error: cannot read redo log header"); log_mutex_exit(); goto fail; } if (log_sys->log.format == 0) { -old_format: - msg("Error: cannot process redo log" - " before MariaDB 10.2.2"); + msg("Error: cannot process redo log before MariaDB 10.2.2"); log_mutex_exit(); - goto log_fail; + goto fail; } const byte* buf = log_sys->checkpoint_buf; - -reread_log_header: checkpoint_lsn_start = log_sys->log.lsn; checkpoint_no_start = log_sys->next_checkpoint_no; - err = recv_find_max_checkpoint(&max_cp_field); - - if (err != DB_SUCCESS) { - goto log_fail; - } - - if (log_sys->log.format == 0) { - goto old_format; - } - log_group_header_read(&log_sys->log, max_cp_field); if (checkpoint_no_start != mach_read_from_8(buf + LOG_CHECKPOINT_NO)) { @@ -4253,6 +4238,12 @@ reread_log_header: mach_write_to_8(log_hdr + LOG_CHECKPOINT_OFFSET, (checkpoint_lsn_start & (OS_FILE_LOG_BLOCK_SIZE - 1)) | LOG_FILE_HDR_SIZE); + /* The least significant bits of LOG_CHECKPOINT_OFFSET must be + stored correctly in the copy of the ib_logfile. The most significant + bits, which identify the start offset of the log block in the file, + we did choose freely, as LOG_FILE_HDR_SIZE. */ + ut_ad(!((log_sys->log.lsn ^ checkpoint_lsn_start) + & (OS_FILE_LOG_BLOCK_SIZE - 1))); log_block_set_checksum(log_hdr, log_block_calc_checksum_crc32(log_hdr)); /* Write checkpoint page 1 and two empty log pages before the -- cgit v1.2.1 From f120a15b93dcb88adc31ad4fc7caf63b813ca63e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20M=C3=A4kel=C3=A4?= Date: Mon, 8 Apr 2019 15:36:03 +0300 Subject: MDEV-19212 4GB Limit on large_pages - integer overflow os_mem_alloc_large(): Invoke the macro ut_2pow_round() with the correct argument type. innobase_large_page_size, innobase_use_large_pages, os_use_large_pages, os_large_page_size: Remove. Simply refer to opt_large_page_size, my_use_large_pages. --- extra/mariabackup/xtrabackup.cc | 5 ----- 1 file changed, 5 deletions(-) (limited to 'extra') diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 3eca4687bbd..2b8abc04446 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -221,8 +221,6 @@ const char *defaults_group = "mysqld"; #define HA_INNOBASE_ROWS_IN_TABLE 10000 /* to get optimization right */ #define HA_INNOBASE_RANGE_COUNT 100 -ulong innobase_large_page_size = 0; - /* The default values for the following, type long or longlong, start-up parameters are declared in mysqld.cc: */ @@ -247,7 +245,6 @@ affects Windows: */ char* innobase_unix_file_flush_method; my_bool innobase_use_doublewrite; -my_bool innobase_use_large_pages; my_bool innobase_file_per_table; my_bool innobase_locks_unsafe_for_binlog; my_bool innobase_rollback_on_timeout; @@ -1919,8 +1916,6 @@ innodb_init_param(void) srv_use_doublewrite_buf = (ibool) innobase_use_doublewrite; - os_use_large_pages = (ibool) innobase_use_large_pages; - os_large_page_size = (ulint) innobase_large_page_size; row_rollback_on_timeout = (ibool) innobase_rollback_on_timeout; srv_file_per_table = (my_bool) innobase_file_per_table; -- cgit v1.2.1