Feed: MariaDB Knowledge Base Article Feed.
Author: .
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.
Mariabackup and BACKUP STAGE
Commands in MariaDB Community Server
The version of Mariabackup that is bundled with MariaDB Community Server does not yet use the BACKUP STAGE
commands in an efficient way. In that version, instead of executing the FLUSH TABLES WITH READ LOCK
command to lock the database, it executes the following BACKUP STAGE
commands:
BACKUP STAGE START; BACKUP STAGE BLOCK_COMMIT;
And then to unlock the database when the backup is complete, it executes the following:
BACKUP STAGE END;
Mariabackup and BACKUP STAGE
Commands in MariaDB Enterprise Server
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 Server
Mariabackup could perform the following tasks in the START
stage:
- Copy all transactional tables.
- Copy the tail of all transaction logs.
- The tail of the InnoDB redo log (i.e.
ib_logfileN
files) will be copied for InnoDB tables. - The tail of the Aria redo log (i.e.
aria_log.N
files) will be copied for Aria tables.
- The tail of the InnoDB redo log (i.e.
BACKUP STAGE FLUSH
in MariaDB Enterprise Server
Mariabackup could perform the following tasks in the FLUSH
stage:
- Copy all non-transactional tables that are not in use. This list of used tables is found with
SHOW OPEN TABLES
. - Copy the tail of all transaction logs.
- The tail of the InnoDB redo log (i.e.
ib_logfileN
files) will be copied for InnoDB tables. - The tail of the Aria redo log (i.e.
aria_log.N
files) will be copied for Aria tables.
- The tail of the InnoDB redo log (i.e.
At this point data for all old tables should have been copied (except for some system tables).
BACKUP STAGE BLOCK_DDL
in MariaDB Enterprise Server
Mariabackup could perform the following tasks in the BLOCK_DDL
stage:
- Copy other files.
- i.e. file extensions
.frm
,.isl
,.TRG
,.TRN
,.opt
,.par
- i.e. file extensions
- Copy the non-transactional tables that were in use during
BACKUP STAGE FLUSH
. - Check
ddl.log
for DDL executed before theBLOCK DDL
stage.- The file names of newly created tables can be read from
ddl.log
. - The file names of dropped tables can also be read from
ddl.log
. - The file names of renamed tables can also be read from
ddl.log
, so the files can be renamed instead of re-copying them.
- The file names of newly created tables can be read from
- Copy changes to system log tables.
- Copy the tail of all transaction logs.
- The tail of the InnoDB redo log (i.e.
ib_logfileN
files) will be copied for InnoDB tables. - The tail of the Aria redo log (i.e.
aria_log.N
files) will be copied for Aria tables.
- The tail of the InnoDB redo log (i.e.
BACKUP STAGE BLOCK_COMMIT
in MariaDB Enterprise Server
Mariabackup could perform the following tasks in the BLOCK_COMMIT
stage:
- Create a MyRocks checkpoint using the
rocksdb_create_checkpoint
system variable. - Copy changes to system log tables.
- Copy changes to statistics tables.
- Copy the tail of all transaction logs.
- The tail of the InnoDB redo log (i.e.
ib_logfileN
files) will be copied for InnoDB tables. - The tail of the Aria redo log (i.e.
aria_log.N
files) will be copied for Aria tables.
- The tail of the InnoDB redo log (i.e.
BACKUP STAGE END
in MariaDB Enterprise Server
Mariabackup could perform the following tasks in the END
stage:
- Copy the MyRocks checkpoint into the backup.