Commit ca76fc4a authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-18611: mariabackup silently ended during xtrabackup_copy_logfile()

log_group_read_log_seg(): Always return false when returning
before reading end_lsn.

xtrabackup_copy_logfile(): On error, indicate whether
a corrupt log record was encountered.

Only xtrabackup_copy_logfile() in Mariabackup cared about the
return value of the function. InnoDB crash recovery was not
affected by this bug.
parent d2fc9d09
...@@ -2756,7 +2756,10 @@ static bool xtrabackup_copy_logfile(bool last = false) ...@@ -2756,7 +2756,10 @@ static bool xtrabackup_copy_logfile(bool last = false)
log_mutex_exit(); log_mutex_exit();
if (!start_lsn) { if (!start_lsn) {
die("xtrabackup_copy_logfile() failed."); msg(recv_sys->found_corrupt_log
? "xtrabackup_copy_logfile() failed: corrupt log."
: "xtrabackup_copy_logfile() failed.");
return true;
} }
} while (start_lsn == end_lsn); } while (start_lsn == end_lsn);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2012, Facebook Inc. Copyright (c) 2012, Facebook Inc.
Copyright (c) 2013, 2018, MariaDB Corporation. Copyright (c) 2013, 2019, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
...@@ -807,7 +807,9 @@ log_group_read_log_seg( ...@@ -807,7 +807,9 @@ log_group_read_log_seg(
happen when InnoDB was killed while it was happen when InnoDB was killed while it was
writing redo log. We simply treat this as an writing redo log. We simply treat this as an
abrupt end of the redo log. */ abrupt end of the redo log. */
fail:
end_lsn = *start_lsn; end_lsn = *start_lsn;
success = false;
break; break;
} }
...@@ -829,9 +831,7 @@ log_group_read_log_seg( ...@@ -829,9 +831,7 @@ log_group_read_log_seg(
<< log_block_get_checkpoint_no(buf) << log_block_get_checkpoint_no(buf)
<< " expected: " << crc << " expected: " << crc
<< " found: " << cksum; << " found: " << cksum;
end_lsn = *start_lsn; goto fail;
success = false;
break;
} }
if (group->is_encrypted()) { if (group->is_encrypted()) {
...@@ -845,8 +845,7 @@ log_group_read_log_seg( ...@@ -845,8 +845,7 @@ log_group_read_log_seg(
|| (dl > OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE || (dl > OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE
&& dl != OS_FILE_LOG_BLOCK_SIZE)) { && dl != OS_FILE_LOG_BLOCK_SIZE)) {
recv_sys->found_corrupt_log = true; recv_sys->found_corrupt_log = true;
end_lsn = *start_lsn; goto fail;
break;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment