Skip to content

Commit

Permalink
MDEV-15071 backup does not store xtrabackup_info in the --extra-lsndi…
Browse files Browse the repository at this point in the history
…r directory
  • Loading branch information
vaintroub committed Feb 15, 2018
1 parent a08121c commit 2129eab
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 8 deletions.
4 changes: 1 addition & 3 deletions extra/mariabackup/backup_copy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1464,12 +1464,10 @@ bool backup_finish()
return(false);
}

if (!write_xtrabackup_info(mysql_connection)) {
if (!write_xtrabackup_info(mysql_connection, XTRABACKUP_INFO, opt_history != 0)) {
return(false);
}



return(true);
}

Expand Down
6 changes: 3 additions & 3 deletions extra/mariabackup/backup_mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ PERCONA_SCHEMA.xtrabackup_history and writes a new history record to the
table containing all the history info particular to the just completed
backup. */
bool
write_xtrabackup_info(MYSQL *connection)
write_xtrabackup_info(MYSQL *connection, const char * filename, bool history)
{

char *uuid = NULL;
Expand Down Expand Up @@ -1426,7 +1426,7 @@ write_xtrabackup_info(MYSQL *connection)
|| xtrabackup_databases_exclude
);

backup_file_printf(XTRABACKUP_INFO,
backup_file_printf(filename,
"uuid = %s\n"
"name = %s\n"
"tool_name = %s\n"
Expand Down Expand Up @@ -1463,7 +1463,7 @@ write_xtrabackup_info(MYSQL *connection)
xb_stream_name[xtrabackup_stream_fmt], /* format */
xtrabackup_compress ? "compressed" : "N"); /* compressed */

if (!opt_history) {
if (!history) {
goto cleanup;
}

Expand Down
2 changes: 1 addition & 1 deletion extra/mariabackup/backup_mysql.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ bool
write_binlog_info(MYSQL *connection);

bool
write_xtrabackup_info(MYSQL *connection);
write_xtrabackup_info(MYSQL *connection, const char * filename, bool history);

bool
write_backup_config_file();
Expand Down
8 changes: 7 additions & 1 deletion extra/mariabackup/xtrabackup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3513,7 +3513,13 @@ xtrabackup_backup_low()
"to '%s'.\n", filename);
return false;
}

sprintf(filename, "%s/%s", xtrabackup_extra_lsndir,
XTRABACKUP_INFO);
if (!write_xtrabackup_info(mysql_connection, filename, false)) {
msg("mariabackup: Error: failed to write info "
"to '%s'.\n", filename);
return false;
}
}

return true;
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/mariabackup/extra_lsndir.result
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
xtrabackup_checkpoints
xtrabackup_info
9 changes: 9 additions & 0 deletions mysql-test/suite/mariabackup/extra_lsndir.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
let $extra_lsndir=$MYSQLTEST_VARDIR/tmp/extra_lsndir;
mkdir $extra_lsndir;
--disable_result_log
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --extra-lsndir=$extra_lsndir;
--enable_result_log
list_files $extra_lsndir;
rmdir $extra_lsndir;
rmdir $targetdir;

0 comments on commit 2129eab

Please sign in to comment.