Browse Source
MDEV-13563 lock DDL for mariabackup in 10.2
MDEV-13563 lock DDL for mariabackup in 10.2
Implement lock-ddl-per-table option that locks tables before it is copied to backup, and helds the lock until backup finished The "DDL-lock" itself is implemented as "SELECT * from <table> LIMIT 0", inside a transaction, and "COMMIT" of this transaction is the DDL-unlock.pull/446/head
6 changed files with 136 additions and 2 deletions
-
94extra/mariabackup/backup_mysql.cc
-
22extra/mariabackup/xtrabackup.cc
-
4extra/mariabackup/xtrabackup.h
-
4mysql-test/suite/mariabackup/lock_ddl_per_table.result
-
12mysql-test/suite/mariabackup/lock_ddl_per_table.test
-
2mysql-test/suite/mariabackup/suite.opt
@ -0,0 +1,4 @@ |
|||
CREATE TABLE t(i INT) ENGINE INNODB; |
|||
INSERT INTO t VALUES(1); |
|||
# xtrabackup backup |
|||
DROP TABLE t; |
@ -0,0 +1,12 @@ |
|||
--source include/have_debug.inc |
|||
|
|||
CREATE TABLE t(i INT) ENGINE INNODB; |
|||
INSERT INTO t VALUES(1); |
|||
echo # xtrabackup backup; |
|||
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; |
|||
|
|||
--disable_result_log |
|||
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --lock-ddl-per-table=1 --dbug=+d,check_mdl_lock_works; |
|||
--enable_result_log |
|||
DROP TABLE t; |
|||
rmdir $targetdir; |
@ -1 +1 @@ |
|||
--innodb --loose-changed_page_bitmaps --innodb-file-format=Barracuda |
|||
--innodb --loose-changed_page_bitmaps --innodb-file-format=Barracuda --innodb-sys-tables |
Write
Preview
Loading…
Cancel
Save
Reference in new issue