diff options
author | Oleksandr Byelkin <sanja@mariadb.com> | 2019-12-09 15:09:41 +0100 |
---|---|---|
committer | Oleksandr Byelkin <sanja@mariadb.com> | 2019-12-09 15:09:41 +0100 |
commit | a15234bf4bf98d7833996284c033fc53a981f5d4 (patch) | |
tree | d989b448854f9d59de5ca16b962414591c8a5b2e /extra/mariabackup/backup_copy.cc | |
parent | 9a6212008999da44b136605c1abf2cc9c7cc4b2c (diff) | |
parent | e5e5877740f248de848219ee3a1d2881cd5c5b82 (diff) | |
download | mariadb-git-a15234bf4bf98d7833996284c033fc53a981f5d4.tar.gz |
Merge branch '10.3' into 10.4
Diffstat (limited to 'extra/mariabackup/backup_copy.cc')
-rw-r--r-- | extra/mariabackup/backup_copy.cc | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc index 176d607fe1c..6a0674bf7f5 100644 --- a/extra/mariabackup/backup_copy.cc +++ b/extra/mariabackup/backup_copy.cc @@ -1665,6 +1665,9 @@ ibx_copy_incremental_over_full() } } + if (!(ret = backup_files_from_datadir(xtrabackup_incremental_dir))) + goto cleanup; + /* copy buffer pool dump */ if (innobase_buffer_pool_filename) { const char *src_name; @@ -2176,20 +2179,26 @@ static bool backup_files_from_datadir(const char *dir_path) if (info.type != OS_FILE_TYPE_FILE) continue; - const char *pname = strrchr(info.name, IF_WIN('\\', '/')); + const char *pname = strrchr(info.name, OS_PATH_SEPARATOR); if (!pname) pname = info.name; - /* Copy aria log files, and aws keys for encryption plugins.*/ - const char *prefixes[] = { "aria_log", "aws-kms-key" }; - for (size_t i = 0; i < array_elements(prefixes); i++) { - if (starts_with(pname, prefixes[i])) { - ret = copy_file(ds_data, info.name, info.name, 1); - if (!ret) { - break; - } - } - } + if (!starts_with(pname, "aws-kms-key") && + !starts_with(pname, "aria_log")) + /* For ES exchange the above line with the following code: + (!xtrabackup_prepare || !xtrabackup_incremental_dir || + !starts_with(pname, "aria_log"))) + */ + continue; + + if (xtrabackup_prepare && xtrabackup_incremental_dir && + file_exists(info.name)) + unlink(info.name); + + std::string full_path(dir_path); + full_path.append(1, OS_PATH_SEPARATOR).append(info.name); + if (!(ret = copy_file(ds_data, full_path.c_str() , info.name, 1))) + break; } os_file_closedir(dir); return ret; |