diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2017-11-03 16:02:19 +0000 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2017-11-03 16:02:19 +0000 |
commit | ffb1eebe05e93d182d0c1fa59a1b368bbc52ec14 (patch) | |
tree | 709b74a637b64efc6d26205c35932775bc2e1d0a /extra | |
parent | 3a3f1328fe1b4c9cfc1175cc5acc3f47acd750e8 (diff) | |
download | mariadb-git-ffb1eebe05e93d182d0c1fa59a1b368bbc52ec14.tar.gz |
MDEV-13560 Copy all innodb undo tablespaces from the backup directory to destination.
Do not check or rely on innodb_undo_tablespaces in copy-back,
there is no good reason for that.
Diffstat (limited to 'extra')
-rw-r--r-- | extra/mariabackup/backup_copy.cc | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index 156e0b20e7c..c019209faad 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -1700,26 +1700,28 @@ copy_back() ut_crc32_init(); /* copy undo tablespaces */ - if (srv_undo_tablespaces > 0) { - dst_dir = (srv_undo_dir && *srv_undo_dir) - ? srv_undo_dir : mysql_data_home; - ds_data = ds_create(dst_dir, DS_TYPE_LOCAL); + dst_dir = (srv_undo_dir && *srv_undo_dir) + ? srv_undo_dir : mysql_data_home; - for (i = 1; i <= srv_undo_tablespaces; i++) { - char filename[20]; - sprintf(filename, "undo%03u", (uint)i); - if (!(ret = copy_or_move_file(filename, filename, - dst_dir, 1))) { - goto cleanup; - } - } + ds_data = ds_create(dst_dir, DS_TYPE_LOCAL); - ds_destroy(ds_data); - ds_data = NULL; + for (i = 1; ; i++) { + char filename[20]; + sprintf(filename, "undo%03u", (uint)i); + if (!file_exists(filename)) { + break; + } + if (!(ret = copy_or_move_file(filename, filename, + dst_dir, 1))) { + goto cleanup; + } } + ds_destroy(ds_data); + ds_data = NULL; + /* copy redo logs */ dst_dir = (srv_log_group_home_dir && *srv_log_group_home_dir) @@ -1844,7 +1846,7 @@ copy_back() } } - /* copy buufer pool dump */ + /* copy buffer pool dump */ if (innobase_buffer_pool_filename) { const char *src_name; |