Skip to content

Commit 2129eab

Browse files
committed
MDEV-15071 backup does not store xtrabackup_info in the --extra-lsndir directory
1 parent a08121c commit 2129eab

File tree

6 files changed

+23
-8
lines changed

6 files changed

+23
-8
lines changed

extra/mariabackup/backup_copy.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1464,12 +1464,10 @@ bool backup_finish()
14641464
return(false);
14651465
}
14661466

1467-
if (!write_xtrabackup_info(mysql_connection)) {
1467+
if (!write_xtrabackup_info(mysql_connection, XTRABACKUP_INFO, opt_history != 0)) {
14681468
return(false);
14691469
}
14701470

1471-
1472-
14731471
return(true);
14741472
}
14751473

extra/mariabackup/backup_mysql.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,7 +1398,7 @@ PERCONA_SCHEMA.xtrabackup_history and writes a new history record to the
13981398
table containing all the history info particular to the just completed
13991399
backup. */
14001400
bool
1401-
write_xtrabackup_info(MYSQL *connection)
1401+
write_xtrabackup_info(MYSQL *connection, const char * filename, bool history)
14021402
{
14031403

14041404
char *uuid = NULL;
@@ -1426,7 +1426,7 @@ write_xtrabackup_info(MYSQL *connection)
14261426
|| xtrabackup_databases_exclude
14271427
);
14281428

1429-
backup_file_printf(XTRABACKUP_INFO,
1429+
backup_file_printf(filename,
14301430
"uuid = %s\n"
14311431
"name = %s\n"
14321432
"tool_name = %s\n"
@@ -1463,7 +1463,7 @@ write_xtrabackup_info(MYSQL *connection)
14631463
xb_stream_name[xtrabackup_stream_fmt], /* format */
14641464
xtrabackup_compress ? "compressed" : "N"); /* compressed */
14651465

1466-
if (!opt_history) {
1466+
if (!history) {
14671467
goto cleanup;
14681468
}
14691469

extra/mariabackup/backup_mysql.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ bool
6868
write_binlog_info(MYSQL *connection);
6969

7070
bool
71-
write_xtrabackup_info(MYSQL *connection);
71+
write_xtrabackup_info(MYSQL *connection, const char * filename, bool history);
7272

7373
bool
7474
write_backup_config_file();

extra/mariabackup/xtrabackup.cc

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3513,7 +3513,13 @@ xtrabackup_backup_low()
35133513
"to '%s'.\n", filename);
35143514
return false;
35153515
}
3516-
3516+
sprintf(filename, "%s/%s", xtrabackup_extra_lsndir,
3517+
XTRABACKUP_INFO);
3518+
if (!write_xtrabackup_info(mysql_connection, filename, false)) {
3519+
msg("mariabackup: Error: failed to write info "
3520+
"to '%s'.\n", filename);
3521+
return false;
3522+
}
35173523
}
35183524

35193525
return true;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
xtrabackup_checkpoints
2+
xtrabackup_info
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
let $targetdir=$MYSQLTEST_VARDIR/tmp/backup;
2+
let $extra_lsndir=$MYSQLTEST_VARDIR/tmp/extra_lsndir;
3+
mkdir $extra_lsndir;
4+
--disable_result_log
5+
exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --target-dir=$targetdir --extra-lsndir=$extra_lsndir;
6+
--enable_result_log
7+
list_files $extra_lsndir;
8+
rmdir $extra_lsndir;
9+
rmdir $targetdir;

0 commit comments

Comments
 (0)