Skip to content

Commit

Permalink
MDEV-18611: mariabackup silently ended during xtrabackup_copy_logfile()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dr-m committed Feb 19, 2019
1 parent d2fc9d0 commit ca76fc4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
5 changes: 4 additions & 1 deletion extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2756,7 +2756,10 @@ static bool xtrabackup_copy_logfile(bool last = false)
log_mutex_exit();

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);

Expand Down
11 changes: 5 additions & 6 deletions storage/innobase/log/log0recv.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved.
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
the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -807,7 +807,9 @@ log_group_read_log_seg(
happen when InnoDB was killed while it was
writing redo log. We simply treat this as an
abrupt end of the redo log. */
fail:
end_lsn = *start_lsn;
success = false;
break;
}

Expand All @@ -829,9 +831,7 @@ log_group_read_log_seg(
<< log_block_get_checkpoint_no(buf)
<< " expected: " << crc
<< " found: " << cksum;
end_lsn = *start_lsn;
success = false;
break;
goto fail;
}

if (group->is_encrypted()) {
Expand All @@ -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)) {
recv_sys->found_corrupt_log = true;
end_lsn = *start_lsn;
break;
goto fail;
}
}

Expand Down

0 comments on commit ca76fc4

Please sign in to comment.