From beec9c0e19284a0e50d3629f4cb2486007b0333b Mon Sep 17 00:00:00 2001 From: Vlad Lesin Date: Wed, 2 Oct 2019 21:11:59 +0300 Subject: MDEV-21255: Deadlock of parallel slave and mariabackup (with failed log copy thread) mariabackup hangs waiting until innodb redo log thread read log till certain LSN, and it waits under FTWRL. If there is redo log read error in the thread, it is finished, and main thread knows nothing about it, what leads to hanging. As it hangs under FTWRL, slave threads on server side can be blocked due to MDL lock conflict. The fix is to finish mariabackup with error message on innodb redo log read failure. --- extra/mariabackup/xtrabackup.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'extra') diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 2ccd59ff13b..e497ba5a972 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -2759,7 +2759,7 @@ static bool xtrabackup_copy_logfile(bool last = false) log_mutex_exit(); if (!start_lsn) { - msg(recv_sys->found_corrupt_log + die(recv_sys->found_corrupt_log ? "xtrabackup_copy_logfile() failed: corrupt log." : "xtrabackup_copy_logfile() failed."); return true; @@ -4281,6 +4281,8 @@ fail_before_log_copying_thread_start: if (xtrabackup_copy_logfile()) goto fail_before_log_copying_thread_start; + DBUG_MARIABACKUP_EVENT("before_innodb_log_copy_thread_started",0); + log_copying_stop = os_event_create(0); os_thread_create(log_copying_thread, NULL, &log_copying_thread_id); -- cgit v1.2.1