From d0150dc14e11f2e0b7ad60b9db40bd65e82e917e Mon Sep 17 00:00:00 2001 From: Vlad Lesin Date: Mon, 27 Apr 2020 21:46:05 +0300 Subject: MDEV-20230: mariabackup --ftwrl-wait-timeout never times out on explicit lock --ftwrl-wait-timeout does not finish mariabackup execution when acquired backup lock can't be grabbed for the certain amount of time, it just waits for a long queries finishing before acquiring the lock to avoid unnecessary locking. This commit extends --ftwrl-wait-timeout so, that mariabackup execution is finished if it waits for backup lock during certain amount of time. --- .../mariabackup/backup_lock_wait_timeout.result | 11 +++++++++ .../mariabackup/backup_lock_wait_timeout.test | 28 ++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 mysql-test/suite/mariabackup/backup_lock_wait_timeout.result create mode 100644 mysql-test/suite/mariabackup/backup_lock_wait_timeout.test (limited to 'mysql-test/suite/mariabackup') diff --git a/mysql-test/suite/mariabackup/backup_lock_wait_timeout.result b/mysql-test/suite/mariabackup/backup_lock_wait_timeout.result new file mode 100644 index 00000000000..9806bc29b47 --- /dev/null +++ b/mysql-test/suite/mariabackup/backup_lock_wait_timeout.result @@ -0,0 +1,11 @@ +CREATE TABLE t(i INT) ENGINE INNODB; +connect con1,localhost,root,,; +BEGIN; +LOCK TABLES t WRITE; +connection default; +# xtrabackup backup +connection con1; +COMMIT; +connection default; +disconnect con1; +DROP TABLE t; diff --git a/mysql-test/suite/mariabackup/backup_lock_wait_timeout.test b/mysql-test/suite/mariabackup/backup_lock_wait_timeout.test new file mode 100644 index 00000000000..e0f43910ef6 --- /dev/null +++ b/mysql-test/suite/mariabackup/backup_lock_wait_timeout.test @@ -0,0 +1,28 @@ +--source include/have_innodb.inc +--source include/count_sessions.inc + +CREATE TABLE t(i INT) ENGINE INNODB; + +connect (con1,localhost,root,,); +BEGIN; +LOCK TABLES t WRITE; + +--connection default + +echo # xtrabackup backup; +let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; + +--disable_result_log +--error 1 +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --ftwrl-wait-timeout=1 --target-dir=$targetdir; +--enable_result_log + +--connection con1 +COMMIT; + +--connection default +--disconnect con1 + +DROP TABLE t; +rmdir $targetdir; +--source include/wait_until_count_sessions.inc -- cgit v1.2.1