summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2022-06-28 09:42:45 +0200
committerSergei Golubchik <serg@mariadb.org>2022-06-28 12:04:15 +0200
commitbf6782c3f45c19dd7f3f9469d765adc49cf849e2 (patch)
treeedc3ceff814e46f3c7ef8eb2f3529308c3899ffb
parent2aa98a2dccbd832d338f75a93dcb8842c2c2e03a (diff)
downloadmariadb-git-bf6782c3f45c19dd7f3f9469d765adc49cf849e2.tar.gz
only copy buffer pool dump in SST galera mode
and then only into the default name, so that the joiner could find it
-rw-r--r--extra/mariabackup/backup_copy.cc55
1 files changed, 16 insertions, 39 deletions
diff --git a/extra/mariabackup/backup_copy.cc b/extra/mariabackup/backup_copy.cc
index 2b07822a386..9f322061ed3 100644
--- a/extra/mariabackup/backup_copy.cc
+++ b/extra/mariabackup/backup_copy.cc
@@ -1483,6 +1483,7 @@ bool backup_start(CorruptedPages &corrupted_pages)
if (!write_galera_info(mysql_connection)) {
return(false);
}
+ // copied from xtrabackup. what is it needed for here?
write_current_binlog_file(mysql_connection);
}
@@ -1523,16 +1524,15 @@ void backup_release()
}
}
+static const char *default_buffer_pool_file = "ib_buffer_pool";
+
/** Finish after backup_start() and backup_release() */
bool backup_finish()
{
/* Copy buffer pool dump or LRU dump */
- if (!opt_rsync) {
+ if (!opt_rsync && opt_galera_info) {
if (buffer_pool_filename && file_exists(buffer_pool_filename)) {
- const char *dst_name;
-
- dst_name = trim_dotslash(buffer_pool_filename);
- copy_file(ds_data, buffer_pool_filename, dst_name, 0);
+ copy_file(ds_data, buffer_pool_filename, default_buffer_pool_file, 0);
}
if (file_exists("ib_lru_dump")) {
copy_file(ds_data, "ib_lru_dump", "ib_lru_dump", 0);
@@ -1582,6 +1582,7 @@ ibx_copy_incremental_over_full()
char path[FN_REFLEN];
int i;
+ DBUG_ASSERT(!opt_galera_info);
datadir_node_init(&node);
/* If we were applying an incremental change set, we need to make
@@ -1618,22 +1619,6 @@ 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;
-
- src_name = trim_dotslash(innobase_buffer_pool_filename);
-
- snprintf(path, sizeof(path), "%s/%s",
- xtrabackup_incremental_dir,
- src_name);
-
- if (file_exists(path)) {
- copy_file(ds_data, path,
- innobase_buffer_pool_filename, 0);
- }
- }
-
/* copy supplementary files */
for (i = 0; sup_files[i]; i++) {
@@ -1938,6 +1923,11 @@ copy_back()
continue;
}
+ /* skip buffer pool dump */
+ if (!strcmp(filename, default_buffer_pool_file)) {
+ continue;
+ }
+
/* skip innodb data files */
for (Tablespace::const_iterator iter(srv_sys_space.begin()),
end(srv_sys_space.end()); iter != end; ++iter) {
@@ -1956,24 +1946,11 @@ copy_back()
/* copy buffer pool dump */
- if (innobase_buffer_pool_filename) {
- const char *src_name;
- char path[FN_REFLEN];
-
- src_name = trim_dotslash(innobase_buffer_pool_filename);
-
- snprintf(path, sizeof(path), "%s/%s",
- mysql_data_home,
- src_name);
-
- /* could be already copied with other files
- from data directory */
- if (file_exists(src_name) &&
- !file_exists(innobase_buffer_pool_filename)) {
- copy_or_move_file(src_name,
- innobase_buffer_pool_filename,
- mysql_data_home, 0);
- }
+ if (file_exists(default_buffer_pool_file) &&
+ innobase_buffer_pool_filename) {
+ copy_or_move_file(default_buffer_pool_file,
+ innobase_buffer_pool_filename,
+ mysql_data_home, 0);
}
rocksdb_copy_back();