Skip to content
Permalink
Browse files
Merge branch '10.4' into 10.5
  • Loading branch information
sanja-byelkin committed Aug 3, 2022
2 parents 7b500f0 + 48e35b8 commit af14347
Show file tree
Hide file tree
Showing 73 changed files with 665 additions and 633 deletions.
@@ -577,6 +577,7 @@ datafile_read(datafile_cur_t *cursor)
Check to see if a file exists.
Takes name of the file to check.
@return true if file exists. */
static
bool
file_exists(const char *filename)
{
@@ -1538,14 +1539,14 @@ 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);
}

bool with_binlogs = opt_binlog_info == BINLOG_INFO_ON;
if (opt_binlog_info == BINLOG_INFO_ON) {

if (with_binlogs || opt_galera_info) {
if (!write_current_binlog_file(mysql_connection, with_binlogs)) {
return(false);
}
lock_binlog_maybe(mysql_connection);
write_binlog_info(mysql_connection);
}

if (have_flush_engine_logs && !opt_no_lock) {
@@ -1581,33 +1582,13 @@ void backup_release()

static const char *default_buffer_pool_file = "ib_buffer_pool";

static
const char * get_buffer_pool_filename(size_t *length)
{
/* If mariabackup is run for Galera, then the file
name is changed to the default so that the receiving
node can find this file and rename it according to its
settings, otherwise we keep the original file name: */
size_t dir_length = 0;
const char *dst_name = default_buffer_pool_file;
if (!opt_galera_info) {
dir_length = dirname_length(buffer_pool_filename);
dst_name = buffer_pool_filename + dir_length;
}
if (length) {
*length=dir_length;
}
return dst_name;
}

/** 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 = get_buffer_pool_filename(NULL);
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);
@@ -1657,6 +1638,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
@@ -1693,19 +1675,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 = get_buffer_pool_filename(NULL);

snprintf(path, sizeof(path), "%s/%s",
xtrabackup_incremental_dir,
src_name);

if (file_exists(path)) {
copy_file(ds_data, path, src_name, 0);
}
}

/* copy supplementary files */

for (i = 0; sup_files[i]; i++) {
@@ -1937,14 +1906,6 @@ copy_back()

datadir_node_init(&node);

/* If mariabackup is run for Galera, then the file
name is changed to the default so that the receiving
node can find this file and rename it according to its
settings, otherwise we keep the original file name: */
size_t dir_length;
const char *src_buffer_pool;
src_buffer_pool = get_buffer_pool_filename(&dir_length);

while (datadir_iter_next(it, &node)) {
const char *ext_list[] = {"backup-my.cnf",
"xtrabackup_binary", "xtrabackup_binlog_info",
@@ -2007,10 +1968,10 @@ copy_back()
continue;
}

/* skip buffer pool dump */
if (!strcmp(filename, src_buffer_pool)) {
continue;
}
/* skip buffer pool dump */
if (!strcmp(filename, default_buffer_pool_file)) {
continue;
}

/* skip innodb data files */
is_ibdata_file = false;
@@ -2034,19 +1995,11 @@ copy_back()

/* copy buffer pool dump */

if (file_exists(src_buffer_pool)) {
char dst_dir[FN_REFLEN];
while (IS_TRAILING_SLASH(buffer_pool_filename, dir_length)) {
dir_length--;
}
memcpy(dst_dir, buffer_pool_filename, dir_length);
dst_dir[dir_length] = 0;
if (!(ret = copy_or_move_file(src_buffer_pool,
src_buffer_pool,
dst_dir, 1)))
{
goto cleanup;
}
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();
@@ -32,13 +32,6 @@ copy_file(ds_ctxt_t *datasink,
const char *dst_file_path,
uint thread_n);

/************************************************************************
Check to see if a file exists.
Takes name of the file to check.
@return true if file exists. */
bool
file_exists(const char *filename);

/** Start --backup */
bool backup_start(CorruptedPages &corrupted_pages);
/** Release resources after backup_start() */

0 comments on commit af14347

Please sign in to comment.