Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-38924

Add pre-freeze and post-thaw scripts for volume-based backups using BACKUP STAGE

    XMLWordPrintable

Details

    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:

      Attachments

        Activity

          People

            Unassigned Unassigned
            Gerd Gerd Aschbrenner
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.