summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2019-02-19 11:14:03 +0200
committerMarko Mäkelä <marko.makela@mariadb.com>2019-02-19 11:14:03 +0200
commitca76fc4a3a1c5f393e1e34005975582e73e84365 (patch)
tree652c5d32048ddcb154652c749d1dced200f05f8f
parentd2fc9d09da007d41d83e9e29a9f2911eb7f8feee (diff)
downloadmariadb-git-ca76fc4a3a1c5f393e1e34005975582e73e84365.tar.gz
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.
-rw-r--r--extra/mariabackup/xtrabackup.cc5
-rw-r--r--storage/innobase/log/log0recv.cc11
2 files changed, 9 insertions, 7 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc
index ecbd118aa3b..acd11135289 100644
--- a/extra/mariabackup/xtrabackup.cc
+++ b/extra/mariabackup/xtrabackup.cc
@@ -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);
diff --git a/storage/innobase/log/log0recv.cc b/storage/innobase/log/log0recv.cc
index bcd6254ebd6..0c0046da989 100644
--- a/storage/innobase/log/log0recv.cc
+++ b/storage/innobase/log/log0recv.cc
@@ -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
@@ -807,7 +807,9 @@ loop:
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;
}
@@ -829,9 +831,7 @@ loop:
<< log_block_get_checkpoint_no(buf)
<< " expected: " << crc
<< " found: " << cksum;
- end_lsn = *start_lsn;
- success = false;
- break;
+ goto fail;
}
if (group->is_encrypted()) {
@@ -845,8 +845,7 @@ loop:
|| (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;
}
}