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.
BACKUP STAGE [START | FLUSH | BLOCK_DDL | BLOCK_COMMIT | END ]
In the following text, a transactional table means InnoDB or "InnoDB-like engine with redo log that can lock redo purges and can be copied without locks by an outside process".
BACKUP STAGE START. The exceptions are system statistic and log tables that are not blocked during the backup until BLOCK_COMMIT. BACKUP STAGE CommandsBACKUP STAGE STARTThe START stage is designed for the following tasks:
BACKUP STAGE FLUSHThe FLUSH stage is designed for the following tasks:
DDLs don't have to be blocked at this stage as they can't cause the table to be in an inconsistent state. This is true also for non-transactional tables.
BACKUP STAGE BLOCK_DDLThe BLOCK_DDL stage is designed for the following tasks:
BACKUP STAGE BLOCK_COMMITThe BLOCK_COMMIT stage is designed for the following tasks:
When the BLOCK_COMMIT's stages return, this is the 'backup time'. Everything committed will be in the backup and everything not committed will roll back.
Transactional engines will continue to do changes to the redo log during the BLOCK COMMIT stage, but this is not important as all of these will roll back later as the changes will not be committed.
BACKUP STAGE ENDThe END stage is designed for the following tasks:
BACKUP STAGE Commands with Backup ToolsBACKUP STAGE Commands with MariabackupThe 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. See Mariabackup and BACKUP STAGE Commands for some examples on how Mariabackup uses these commands.
If you would like to use a version of Mariabackup that uses the BACKUP STAGE commands in an efficient way, then one option is to use MariaDB Enterprise Backup that is bundled with MariaDB Enterprise Server.
BACKUP STAGE Commands with Storage SnapshotsThe BACKUP STAGE commands are a set of commands to make it possible to make an efficient external backup tool. These commands could even be used by tools that perform backups by taking a snapshot of a file system, SAN, or some other kind of storage device. See Storage Snapshots and BACKUP STAGE Commands for some examples on how to use each BACKUP STAGE command in an efficient way.
BACKUP STAGE requires the RELOAD privilege.
BACKUP STAGE START. If a second connection tries, it will wait until the first one has executed BACKUP STAGE END. BACKUP STAGE, then all intermediate backup stages will automatically be run. This will allow us to add new stages within the BACKUP STAGE hierarchy in the future with even more precise locks without causing problems for tools using an earlier version of the BACKUP STAGE implementation. max_statement_time or lock_wait_timeout system variables to ensure that a BACKUP STAGE command doesn't block the server too long.
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.
https://mariadb.com/kb/en/backup-stage/