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.
A tool that backs up MariaDB by taking a snapshot of a file system, SAN, or some other kind of storage device could use each
BACKUP STAGE command in the following way:
BACKUP STAGE START BACKUP STAGE BLOCK_COMMIT
BACKUP STAGE END
The above ensures that all non-transactional tables are properly flushed to disk before the snapshot is done. Using
BACKUP STAGE commands is also more efficient than using the
FLUSH TABLES WITH READ LOCK command as the above set of commands will not block or be blocked by write operations to transactional tables.
Note that when the backup is completed, one should delete all files with the "#sql" prefix, as these are files used by concurrent running
ALTER TABLE. Note that InnoDB will on server restart automatically delete any tables with the "#sql" prefix.
© 2019 MariaDB
Licensed under the Creative Commons Attribution 3.0 Unported License and the GNU Free Documentation License.