Details
-
New Feature
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
None
Description
Overview
Add official pre-freeze and post-thaw scripts to enable consistent volume-based backups of MariaDB using storage snapshots (Veeam, Commvault, etc.) with the BACKUP STAGE commands.
Motivation
Many organizations use enterprise backup solutions that rely on storage-level snapshots. Currently, there are no official scripts to integrate MariaDB's BACKUP STAGE functionality with these backup products. Users either:
- Use FLUSH TABLES WITH READ LOCK (FTWRL), which blocks all reads
- Use mariadb-backup, which requires extra disk space, I/O, and more complex recovery procedures
- Take inconsistent snapshots
Proposed Solution
Provide scripts that:
- Pre-freeze script: Executes BACKUP STAGE START → BACKUP STAGE BLOCK_COMMIT before the snapshot
- Post-thaw script: Executes BACKUP STAGE END after the snapshot completes
- Maintain the same database session across both scripts (required for BACKUP STAGE to work)
- Include proper error handling and logging
- Support configuration via command-line parameters or configuration file
Key Advantages
- No read locks on the database (unlike FTWRL)
- Very brief write lock (only during BLOCK_COMMIT)
- No extra disk space required on the database server
- No additional I/O during backup operations
- Simple recovery: Just restore the VM snapshot and start MariaDB
- Minimal impact on production workloads
Technical Challenges
The BACKUP STAGE commands are session-based, requiring the database connection to remain alive between the pre-freeze and post-thaw scripts. This makes the implementation more complex than the traditional FTWRL approach.
Use Case
Organizations with:
- Large databases across multiple VMs
- Enterprise backup solutions (Veeam, Commvault, etc.)
- Limited disk space for staging backups
- Need for minimal backup impact on production
- Infrequent, controlled DDL operations
Discussions in: