diff options
author | Alexander Barkov <bar@mariadb.org> | 2018-01-23 17:43:12 +0400 |
---|---|---|
committer | Alexander Barkov <bar@mariadb.org> | 2018-01-23 17:43:12 +0400 |
commit | ec6b8c546a433b4a4f66e3c483807c1159c9c543 (patch) | |
tree | 2bed00fba5974a92ef1e4ef3504060cc43acaa07 /extra | |
parent | c425dcd8f23c4677bf71d03980753fe60b31f6a4 (diff) | |
parent | 7cc507f22e6eaec5ec83e24cd45275656bc7962f (diff) | |
download | mariadb-git-ec6b8c546a433b4a4f66e3c483807c1159c9c543.tar.gz |
Merge remote-tracking branch 'origin/10.2' into bb-10.2-ext
Diffstat (limited to 'extra')
-rw-r--r-- | extra/mariabackup/xtrabackup.cc | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/extra/mariabackup/xtrabackup.cc b/extra/mariabackup/xtrabackup.cc index 375d8845a2a..7eee64bd6ef 100644 --- a/extra/mariabackup/xtrabackup.cc +++ b/extra/mariabackup/xtrabackup.cc @@ -433,6 +433,22 @@ datafiles_iter_free(datafiles_iter_t *it) free(it); } +void mdl_lock_all() +{ + mdl_lock_init(); + datafiles_iter_t *it = datafiles_iter_new(fil_system); + if (!it) + return; + + while (fil_node_t *node = datafiles_iter_next(it)){ + if (fil_is_user_tablespace_id(node->space->id) + && check_if_skip_table(node->space->name)) + continue; + + mdl_lock_table(node->space->id); + } + datafiles_iter_free(it); +} /* ======== Date copying thread context ======== */ typedef struct { @@ -2199,10 +2215,6 @@ xtrabackup_copy_datafile(fil_node_t* node, uint thread_n) return(FALSE); } - if (opt_lock_ddl_per_table) { - mdl_lock_table(node->space->id); - } - if (!changed_page_bitmap) { read_filter = &rf_pass_through; } @@ -3562,9 +3574,7 @@ xtrabackup_backup_func() "or RENAME TABLE during the backup, inconsistent backup will be " "produced.\n"); - if (opt_lock_ddl_per_table) { - mdl_lock_init(); - } + /* initialize components */ if(innodb_init_param()) { @@ -3879,6 +3889,10 @@ reread_log_header: "files transfer\n", xtrabackup_parallel); } + if (opt_lock_ddl_per_table) { + mdl_lock_all(); + } + it = datafiles_iter_new(fil_system); if (it == NULL) { msg("mariabackup: Error: datafiles_iter_new() failed.\n"); |