Skip to content

Commit ca76fc4

Browse files
committed
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.
1 parent d2fc9d0 commit ca76fc4

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

extra/mariabackup/xtrabackup.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2756,7 +2756,10 @@ static bool xtrabackup_copy_logfile(bool last = false)
27562756
log_mutex_exit();
27572757

27582758
if (!start_lsn) {
2759-
die("xtrabackup_copy_logfile() failed.");
2759+
msg(recv_sys->found_corrupt_log
2760+
? "xtrabackup_copy_logfile() failed: corrupt log."
2761+
: "xtrabackup_copy_logfile() failed.");
2762+
return true;
27602763
}
27612764
} while (start_lsn == end_lsn);
27622765

storage/innobase/log/log0recv.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
Copyright (c) 1997, 2017, Oracle and/or its affiliates. All Rights Reserved.
44
Copyright (c) 2012, Facebook Inc.
5-
Copyright (c) 2013, 2018, MariaDB Corporation.
5+
Copyright (c) 2013, 2019, MariaDB Corporation.
66
77
This program is free software; you can redistribute it and/or modify it under
88
the terms of the GNU General Public License as published by the Free Software
@@ -807,7 +807,9 @@ log_group_read_log_seg(
807807
happen when InnoDB was killed while it was
808808
writing redo log. We simply treat this as an
809809
abrupt end of the redo log. */
810+
fail:
810811
end_lsn = *start_lsn;
812+
success = false;
811813
break;
812814
}
813815

@@ -829,9 +831,7 @@ log_group_read_log_seg(
829831
<< log_block_get_checkpoint_no(buf)
830832
<< " expected: " << crc
831833
<< " found: " << cksum;
832-
end_lsn = *start_lsn;
833-
success = false;
834-
break;
834+
goto fail;
835835
}
836836

837837
if (group->is_encrypted()) {
@@ -845,8 +845,7 @@ log_group_read_log_seg(
845845
|| (dl > OS_FILE_LOG_BLOCK_SIZE - LOG_BLOCK_TRL_SIZE
846846
&& dl != OS_FILE_LOG_BLOCK_SIZE)) {
847847
recv_sys->found_corrupt_log = true;
848-
end_lsn = *start_lsn;
849-
break;
848+
goto fail;
850849
}
851850
}
852851

0 commit comments

Comments
 (0)