mariadb-backup and BACKUP STAGE
Understand backup locking stages. This page explains how mariadb-backup uses BACKUP STAGE statements to minimize locking during operation.
The BACKUP STAGE statements make it possible to make an efficient external backup tool. How mariadb-backup uses these statements 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 in MariaDB Community Server
The statements are supported. However, the version of mariadb-backup that is bundled with MariaDB Community Server does not yet use the BACKUP STAGE statement in the most efficient way. mariadb-backup simply executes the following BACKUP STAGE statement to lock the database:
When the backup is complete, it executes the following BACKUP STAGE statement to unlock the database:
Tasks Performed Prior to BACKUP STAGE in MariaDB Community Server
Copy some transactional tables.
InnoDB (i.e. ibdataN and file extensions .ibd and .isl)
BACKUP STAGE START in MariaDB Community Server
mariadb-backup from MariaDB Community Server does not perform any tasks in the START stage.
BACKUP STAGE FLUSH in MariaDB Community Server
mariadb-backup from MariaDB Community Server does not currently perform any tasks in the FLUSH stage.
BACKUP STAGE BLOCK_DDL in MariaDB Community Server
mariadb-backup from MariaDB Community Server does not currently perform any tasks in the BLOCK_DDL stage.
BACKUP STAGE BLOCK_COMMIT in MariaDB Community Server
mariadb-backup from MariaDB Community Server performs the following tasks in the BLOCK_COMMIT stage:
Copy other files.
i.e. file extensions .frm, .isl, .TRG, .TRN, .opt, .par
BACKUP STAGE END in MariaDB Community Server
mariadb-backup from MariaDB Community Server performs the following tasks in the END stage:
Copy the MyRocks checkpoint into the backup.
BACKUP STAGE in MariaDB Enterprise Server
The following sections describe how the MariaDB Backup version of mariadb-backup that is bundled with MariaDB Enterprise Server uses each statement in an efficient way.
BACKUP STAGE START in MariaDB Enterprise Server
mariadb-backup from MariaDB Enterprise Server performs the following tasks in the START stage:
Copy all transactional tables.
InnoDB (i.e. ibdataN and file extensions .ibd and .isl)
BACKUP STAGE FLUSH in MariaDB Enterprise Server
mariadb-backup from MariaDB Enterprise Server performs 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.
MyISAM (i.e. file extensions .MYD and .MYI)
BACKUP STAGE BLOCK_DDL in MariaDB Enterprise Server
mariadb-backup from MariaDB Enterprise Server performs the following tasks in the BLOCK_DDL stage:
Copy other files.
i.e. file extensions .frm, .isl, .TRG, .TRN, .opt, .par
BACKUP STAGE BLOCK_COMMIT in MariaDB Enterprise Server
mariadb-backup from MariaDB Enterprise Server performs 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.
BACKUP STAGE END in MariaDB Enterprise Server
mariadb-backup from MariaDB Enterprise Server performs the following tasks in the END stage:
Copy the MyRocks checkpoint into the backup.
This page is licensed: CC BY-SA / Gnu FDL