Skip to content

Commit b314f7b

Browse files
abarkovvuvova
authored andcommitted
MDEV-18931 Rename Mariabackup's xtrabackup_* files to mariadb_backup_*
Renaming the default MariaDB backup directory from xtrabackup_backupfiles to mariadb_backup_files. Renaming files: - xtrabackup_binlog_info to mariadb_backup_binlog_info - xtrabackup_checkpoints to mariadb_backup_checkpoints - xtrabackup_galera_info to mariadb_backup_galera_info - xtrabackup_info to mariadb_backup_info - xtrabackup_slave_info to mariadb_backup_slave_info
1 parent 4ae9733 commit b314f7b

17 files changed

+202
-86
lines changed

extra/mariabackup/backup_copy.cc

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,7 +1557,7 @@ bool backup_finish()
15571557
return(false);
15581558
}
15591559

1560-
if (!write_xtrabackup_info(mysql_connection, XTRABACKUP_INFO,
1560+
if (!write_xtrabackup_info(mysql_connection, MB_INFO,
15611561
opt_history != 0, true)) {
15621562
return(false);
15631563
}
@@ -1613,10 +1613,14 @@ ibx_copy_incremental_over_full()
16131613
const char *ext_list[] = {"frm", "isl", "MYD", "MYI", "MAD", "MAI",
16141614
"MRG", "TRG", "TRN", "ARM", "ARZ", "CSM", "CSV", "opt", "par",
16151615
NULL};
1616-
const char *sup_files[] = {"xtrabackup_binlog_info",
1617-
"xtrabackup_galera_info",
1618-
"xtrabackup_slave_info",
1619-
"xtrabackup_info",
1616+
const char *sup_files[] = {MB_BINLOG_INFO,
1617+
MB_GALERA_INFO,
1618+
MB_SLAVE_INFO,
1619+
MB_INFO,
1620+
XTRABACKUP_BINLOG_INFO,
1621+
XTRABACKUP_GALERA_INFO,
1622+
XTRABACKUP_SLAVE_INFO,
1623+
XTRABACKUP_INFO,
16201624
"ib_lru_dump",
16211625
NULL};
16221626
datadir_iter_t *it = NULL;
@@ -1894,8 +1898,12 @@ copy_back()
18941898

18951899
while (datadir_iter_next(it, &node)) {
18961900
const char *ext_list[] = {"backup-my.cnf",
1897-
"xtrabackup_binary", "xtrabackup_binlog_info",
1898-
"xtrabackup_checkpoints", ".qp", ".pmap", ".tmp",
1901+
"xtrabackup_binary",
1902+
MB_BINLOG_INFO,
1903+
MB_METADATA_FILENAME,
1904+
XTRABACKUP_BINLOG_INFO,
1905+
XTRABACKUP_METADATA_FILENAME,
1906+
".qp", ".pmap", ".tmp",
18991907
NULL};
19001908
const char *filename;
19011909
char c_tmp;

extra/mariabackup/backup_copy.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,19 @@
66
#include <mysql.h>
77
#include "datasink.h"
88

9-
/* special files */
9+
/* special files, backward compatibility */
1010
#define XTRABACKUP_SLAVE_INFO "xtrabackup_slave_info"
1111
#define XTRABACKUP_GALERA_INFO "xtrabackup_galera_info"
1212
#define XTRABACKUP_BINLOG_INFO "xtrabackup_binlog_info"
1313
#define XTRABACKUP_INFO "xtrabackup_info"
14+
#define XTRABACKUP_METADATA_FILENAME "xtrabackup_checkpoints"
15+
16+
/* special files */
17+
#define MB_SLAVE_INFO "mariadb_backup_slave_info"
18+
#define MB_GALERA_INFO "mariadb_backup_galera_info"
19+
#define MB_BINLOG_INFO "mariadb_backup_binlog_info"
20+
#define MB_INFO "mariadb_backup_info"
21+
#define MB_METADATA_FILENAME "mariadb_backup_checkpoints"
1422

1523
extern bool binlog_locked;
1624

extra/mariabackup/backup_mysql.cc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ write_slave_info(MYSQL *connection)
13391339
}
13401340

13411341
mysql_slave_position= strdup(comment.c_ptr());
1342-
return backup_file_print_buf(XTRABACKUP_SLAVE_INFO, sql.ptr(), sql.length());
1342+
return backup_file_print_buf(MB_SLAVE_INFO, sql.ptr(), sql.length());
13431343
}
13441344

13451345

@@ -1362,7 +1362,7 @@ write_galera_info(MYSQL *connection)
13621362
};
13631363

13641364
/* When backup locks are supported by the server, we should skip
1365-
creating xtrabackup_galera_info file on the backup stage, because
1365+
creating MB_GALERA_INFO file on the backup stage, because
13661366
wsrep_local_state_uuid and wsrep_last_committed will be inconsistent
13671367
without blocking commits. The state file will be created on the prepare
13681368
stage using the WSREP recovery procedure. */
@@ -1379,7 +1379,7 @@ write_galera_info(MYSQL *connection)
13791379
goto cleanup;
13801380
}
13811381

1382-
result = backup_file_printf(XTRABACKUP_GALERA_INFO,
1382+
result = backup_file_printf(MB_GALERA_INFO,
13831383
"%s:%s\n", state_uuid ? state_uuid : state_uuid55,
13841384
last_committed ? last_committed : last_committed55);
13851385
if (result)
@@ -1513,7 +1513,7 @@ write_binlog_info(MYSQL *connection)
15131513
read_mysql_variables(connection, "SHOW VARIABLES", vars, true);
15141514

15151515
if (filename == NULL || position == NULL) {
1516-
/* Do not create xtrabackup_binlog_info if binary
1516+
/* Do not create MB_BINLOG_INFO if binary
15171517
log is disabled */
15181518
result = true;
15191519
goto cleanup;
@@ -1529,14 +1529,14 @@ write_binlog_info(MYSQL *connection)
15291529
"filename '%s', position '%s', "
15301530
"GTID of the last change '%s'",
15311531
filename, position, gtid) != -1);
1532-
result = backup_file_printf(XTRABACKUP_BINLOG_INFO,
1532+
result = backup_file_printf(MB_BINLOG_INFO,
15331533
"%s\t%s\t%s\n", filename, position,
15341534
gtid);
15351535
} else {
15361536
ut_a(asprintf(&mysql_binlog_position,
15371537
"filename '%s', position '%s'",
15381538
filename, position) != -1);
1539-
result = backup_file_printf(XTRABACKUP_BINLOG_INFO,
1539+
result = backup_file_printf(MB_BINLOG_INFO,
15401540
"%s\t%s\n", filename, position);
15411541
}
15421542

@@ -1571,7 +1571,7 @@ operator<<(std::ostream& s, const escape_and_quote& eq)
15711571
}
15721572

15731573
/*********************************************************************//**
1574-
Writes xtrabackup_info file and if backup_history is enable creates
1574+
Writes MB_INFO file and if backup_history is enable creates
15751575
mysql.mariabackup_history and writes a new history record to the
15761576
table containing all the history info particular to the just completed
15771577
backup. */
@@ -1647,7 +1647,7 @@ write_xtrabackup_info(MYSQL *connection, const char * filename, bool history,
16471647
xb_stream_name[xtrabackup_stream_fmt], /* format */
16481648
xtrabackup_compress ? "compressed" : "N"); /* compressed */
16491649
if (buf_len < 0) {
1650-
msg("Error: cannot generate xtrabackup_info");
1650+
msg("Error: cannot generate " MB_INFO);
16511651
result = false;
16521652
goto cleanup;
16531653
}

extra/mariabackup/backup_wsrep.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA
2323
#define BACKUP_WSREP_H
2424

2525
/***********************************************************************
26-
Store Galera checkpoint info in the 'xtrabackup_galera_info' file, if that
26+
Store Galera checkpoint info in the MB_GALERA_INFO file, if that
2727
information is present in the trx system header. Otherwise, do nothing. */
2828
void
2929
xb_write_galera_info(bool incremental_prepare);

extra/mariabackup/innobackupex.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static struct my_option ibx_long_options[] =
242242
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
243243

244244
{"galera-info", OPT_GALERA_INFO, "This options creates the "
245-
"xtrabackup_galera_info file which contains the local node state at "
245+
MB_GALERA_INFO " file which contains the local node state at "
246246
"the time of the backup. Option should be used when performing the "
247247
"backup of MariaDB Galera Cluster. Has no effect when backup locks "
248248
"are used to create the backup.",
@@ -252,10 +252,10 @@ static struct my_option ibx_long_options[] =
252252
{"slave-info", OPT_SLAVE_INFO, "This option is useful when backing "
253253
"up a replication slave server. It prints the binary log position "
254254
"and name of the master server. It also writes this information to "
255-
"the \"xtrabackup_slave_info\" file as a \"CHANGE MASTER\" command. "
255+
"the \"" MB_SLAVE_INFO "\" file as a \"CHANGE MASTER\" command. "
256256
"A new slave for this master can be set up by starting a slave server "
257257
"on this backup and issuing a \"CHANGE MASTER\" command with the "
258-
"binary log position saved in the \"xtrabackup_slave_info\" file.",
258+
"binary log position saved in the \"" MB_SLAVE_INFO "\" file.",
259259
(uchar *) &opt_ibx_slave_info, (uchar *) &opt_ibx_slave_info, 0,
260260
GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
261261

@@ -518,7 +518,7 @@ static struct my_option ibx_long_options[] =
518518

519519
{"extra-lsndir", OPT_EXTRA_LSNDIR, "This option specifies the "
520520
"directory in which to save an extra copy of the "
521-
"\"xtrabackup_checkpoints\" file. The option accepts a string "
521+
"\"" MB_METADATA_FILENAME "\" file. The option accepts a string "
522522
"argument.",
523523
(uchar*) &ibx_xtrabackup_extra_lsndir,
524524
(uchar*) &ibx_xtrabackup_extra_lsndir,

extra/mariabackup/wsrep.cc

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,10 @@ permission notice:
5353

5454
/*! Name of file where Galera info is stored on recovery */
5555
#define XB_GALERA_INFO_FILENAME "xtrabackup_galera_info"
56+
#define MB_GALERA_INFO_FILENAME "mariadb_backup_galera_info"
5657

5758
/***********************************************************************
58-
Store Galera checkpoint info in the 'xtrabackup_galera_info' file, if that
59+
Store Galera checkpoint info in the MB_GALERA_INFO_FILENAME file, if that
5960
information is present in the trx system header. Otherwise, do nothing. */
6061
void
6162
xb_write_galera_info(bool incremental_prepare)
@@ -70,7 +71,8 @@ xb_write_galera_info(bool incremental_prepare)
7071
/* Do not overwrite existing an existing file to be compatible with
7172
servers with older server versions */
7273
if (!incremental_prepare &&
73-
my_stat(XB_GALERA_INFO_FILENAME, &statinfo, MYF(0)) != NULL) {
74+
(my_stat(XB_GALERA_INFO_FILENAME, &statinfo, MYF(0)) != NULL ||
75+
my_stat(MB_GALERA_INFO_FILENAME, &statinfo, MYF(0)) != NULL)) {
7476

7577
return;
7678
}
@@ -89,11 +91,11 @@ xb_write_galera_info(bool incremental_prepare)
8991
return;
9092
}
9193

92-
fp = fopen(XB_GALERA_INFO_FILENAME, "w");
94+
fp = fopen(MB_GALERA_INFO_FILENAME, "w");
9395
if (fp == NULL) {
9496

9597
die(
96-
"could not create " XB_GALERA_INFO_FILENAME
98+
"could not create " MB_GALERA_INFO_FILENAME
9799
", errno = %d\n",
98100
errno);
99101
exit(EXIT_FAILURE);
@@ -107,7 +109,7 @@ xb_write_galera_info(bool incremental_prepare)
107109
if (fprintf(fp, "%s:%lld", uuid_str, (long long) seqno) < 0) {
108110

109111
die(
110-
"could not write to " XB_GALERA_INFO_FILENAME
112+
"could not write to " MB_GALERA_INFO_FILENAME
111113
", errno = %d\n",
112114
errno);;
113115
}

0 commit comments

Comments
 (0)