The BACKUP STAGE
commands were introduced in MariaDB 10.4.1.
The BACKUP STAGE
commands are a set of commands to make it possible to make an efficient external backup tool. How Mariabackup uses these commands depends on whether you are using the version that is bundled with MariaDB Community Server or the version that is bundled with MariaDB Enterprise Server.
BACKUP STAGE
Commands in MariaDB Community ServerIn MariaDB Community Server, Mariabackup first supported BACKUP STAGE
commands in MariaDB 10.4.1.
In MariaDB 10.3 and before, the BACKUP STAGE
commands are not supported, so Mariabackup executes the FLUSH TABLES WITH READ LOCK
command to lock the database. When the backup is complete, it executes the UNLOCK TABLES
command to unlock the database.
In MariaDB 10.4 and later, the BACKUP STAGE
commands are supported. However, the version of Mariabackup that is bundled with MariaDB Community Server does not yet use the BACKUP STAGE
commands in the most efficient way. Mariabackup simply executes the following BACKUP STAGE
commands to lock the database:
BACKUP STAGE START; BACKUP STAGE BLOCK_COMMIT;
When the backup is complete, it executes the following BACKUP STAGE
command to unlock the database:
BACKUP STAGE END;
If you would like to use a version of Mariabackup that uses the BACKUP STAGE
commands in the most efficient way, then your best option is to use MariaDB Enterprise Backup that is bundled with MariaDB Enterprise Server.
BACKUP STAGE
in MariaDB Community ServeribdataN
and file extensions .ibd
and .isl
) ib_logfileN
files) will be copied for InnoDB tables. BACKUP STAGE START
in MariaDB Community ServerMariabackup from MariaDB Community Server does not currently perform any tasks in the START
stage.
BACKUP STAGE FLUSH
in MariaDB Community ServerMariabackup from MariaDB Community Server does not currently perform any tasks in the FLUSH
stage.
BACKUP STAGE BLOCK_DDL
in MariaDB Community ServerMariabackup from MariaDB Community Server does not currently perform any tasks in the BLOCK_DDL
stage.
BACKUP STAGE BLOCK_COMMIT
in MariaDB Community ServerMariabackup from MariaDB Community Server performs the following tasks in the BLOCK_COMMIT
stage:
.frm
, .isl
, .TRG
, .TRN
, .opt
, .par
aria_log_control
and file extensions .MAD
and .MAI
) rocksdb_create_checkpoint
system variable. ib_logfileN
files) will be copied for InnoDB tables. xtrabackup_binlog_info
. xtrabackup_galera_info
. BACKUP STAGE END
in MariaDB Community ServerMariabackup from MariaDB Community Server performs the following tasks in the END
stage:
BACKUP STAGE
Commands in MariaDB Enterprise ServerMariaDB Enterprise Backup first supported BACKUP STAGE
commands in MariaDB Enterprise Server 10.4.6-1, MariaDB Enterprise Server 10.3.16-1, and MariaDB Enterprise Server 10.2.25-1.
The following sections describe how the MariaDB Enterprise Backup version of Mariabackup that is bundled with MariaDB Enterprise Server uses each BACKUP STAGE
command in an efficient way.
BACKUP STAGE START
in MariaDB Enterprise ServerMariabackup from MariaDB Enterprise Server performs the following tasks in the START
stage:
ib_logfileN
files) will be copied for InnoDB tables. aria_log.N
files) will be copied for Aria tables. BACKUP STAGE FLUSH
in MariaDB Enterprise ServerMariabackup from MariaDB Enterprise Server performs the following tasks in the FLUSH
stage:
SHOW OPEN TABLES
. ib_logfileN
files) will be copied for InnoDB tables. aria_log.N
files) will be copied for Aria tables. BACKUP STAGE BLOCK_DDL
in MariaDB Enterprise ServerMariabackup from MariaDB Enterprise Server performs the following tasks in the BLOCK_DDL
stage:
.frm
, .isl
, .TRG
, .TRN
, .opt
, .par
BACKUP STAGE FLUSH
. ddl.log
for DDL executed before the BLOCK DDL
stage. ddl.log
. ddl.log
. ddl.log
, so the files can be renamed instead of re-copying them. mysql.general_log
mysql.slow_log
ib_logfileN
files) will be copied for InnoDB tables. aria_log.N
files) will be copied for Aria tables. BACKUP STAGE BLOCK_COMMIT
in MariaDB Enterprise ServerMariabackup from MariaDB Enterprise Server performs the following tasks in the BLOCK_COMMIT
stage:
rocksdb_create_checkpoint
system variable. mysql.general_log
mysql.slow_log
ib_logfileN
files) will be copied for InnoDB tables. aria_log.N
files) will be copied for Aria tables. xtrabackup_binlog_info
. xtrabackup_galera_info
. BACKUP STAGE END
in MariaDB Enterprise ServerMariabackup from MariaDB Enterprise Server performs the following tasks in the END
stage:
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/mariabackup-and-backup-stage-commands/