Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Won't Fix
-
10.3.11, 10.2(EOL), 10.4(EOL)
-
None
Description
Mariabackup silently stopped in some cases.
Regarding an analysis from vlad.lesin , it will be happen, if
log_sys.log.read_log_seg() returns 0, even if there was something wring during reading.
Variant 1:
log_sys.log.read_log_seg() returned true, but lsn == start_lsn.
) log_sys.log.read_log_seg() returned true, but lsn == start_lsn. If we look into log_t::files::read_log_seg(), we will see that the function can silently return true and do not advance lsn on the following condition: |
=== log_t::files::read_log_seg()
|
if (block_number != log_block_convert_lsn_to_no(*start_lsn)) { |
/* Garbage or an incompletely written log block.
|
We will not report any error, because this can
|
happen when InnoDB was killed while it was
|
writing redo log. We simply treat this as an
|
abrupt end of the redo log. */
|
end_lsn = *start_lsn;
|
break; |
}
|
Variant 2:
Downloaded buffer is unequal to expected datasize.
|
=== log_t::files::read_log_seg()
|
if (dl < LOG_BLOCK_HDR_SIZE |
|| (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; |
}
|
=== log_t::files::read_log_seg()
|
But in this case the flag about corrupted log is set.
Suggested fix from vlad.lesin
|
===
|
--- a/extra/mariabackup/xtrabackup.cc
|
+++ b/extra/mariabackup/xtrabackup.cc
|
@@ -2728,13 +2728,19 @@ static bool xtrabackup_copy_logfile(bool last = false) |
lsn_t lsn= start_lsn;
|
for (int retries= 0; retries < 100; retries++) { |
if (log_sys.log.read_log_seg(&lsn, end_lsn) |
- || lsn != start_lsn) {
|
+ && lsn != start_lsn) {
|
break; |
}
|
msg("Retrying read of log at LSN=" LSN_PF "\n", lsn); |
my_sleep(1000);
|
}
|
|
+ if (recv_sys->found_corrupt_log) { |
+ msg("mariabackup: Error: xtrabackup_copy_logfile()" |
+ " found corrupted log.\n"); |
+ exit(EXIT_FAILURE); |
+ }
|
+
|
start_lsn = (lsn == start_lsn)
|
? 0 : xtrabackup_copy_log(start_lsn, lsn, last);
|
|
===
|
Attachments
Issue Links
- is duplicated by
-
MDEV-18612 mariabackup: Error: xtrabackup_copy_logfile() failed.
- Closed
-
MDEV-19492 Mariabackup hangs if table populated with INSERT... SELECT while it runs
- Stalled
- relates to
-
MDEV-17029 mariabackup fails under load with schema changes
- Closed
-
MDEV-23711 make mariabackup innodb redo log read error message more clear
- Closed