Skip to content
logo
Percona XtraBackup
Take an incremental backup using page tracking
Initializing search
    percona/pxb-docs
    percona/pxb-docs
    • Home
      • About Percona XtraBackup
      • How Percona XtraBackup works
      • Understand version numbers
      • Install Percona XtraBackup 8.0
      • Use an APT repo to install Percona XtraBackup
      • Use a YUM repo to install Percona XtraBackup
      • Use DEB or RPM downloaded packages to install Percona XtraBackup
      • Install Percona XtraBackup from a Binary Tarball
      • Compile and install Percona XtraBackup from source code
      • What’s in the packages
      • Uninstall Percona XtraBackup
      • Run Percona XtraBackup in a Docker container
      • Implementation details
      • Connection and privileges needed
      • Configure xtrabackup
      • Server version and backup version comparison
      • xtrabackup exit codes
      • The backup cycle - full backups
      • Incremental backup
      • Compressed backup
      • Partial backups
      • Percona XtraBackup user manual
      • Throttling backups
      • Encrypted InnoDB tablespace backups
      • Encrypt backups
      • LRU dump backup
      • Point-in-time recovery
      • Smart memory estimation
      • Work with binary logs
      • Improved log statements
      • Work with SELinux
      • Work with AppArmor
      • Enable the server to communicate via TCP/IP
      • Install and configure an SSH server
      • Analyze table statistics
      • FLUSH TABLES WITH READ LOCK option
      • lock-ddl-per-table option improvements
      • Take an incremental backup using page tracking
        • Install the component
        • Use page tracking
        • Start page tracking manually
        • Check the LSN value
        • Stop page tracking
        • Purge page tracking data
        • Known issue
        • Uninstall the mysqlbackup component
      • The xbcloud binary
      • Use the xbcloud binary with Swift
      • Use xbcloud Binary with Amazon S3
      • Use the xbcloud binary with MinIO
      • Use the xbcloud with Google Cloud Storage
      • Exponential backoff
      • Use the xbcloud binary with Microsoft Azure Cloud Storage
      • How-tos and recipes
      • Release notes index
      • Percona XtraBackup 8.0.30-23 (2022-11-14)
      • Percona XtraBackup 8.0.29-22 (2022-07-19)
      • Percona XtraBackup 8.0.28-21 (2022-05-25)
      • Percona XtraBackup 8.0.28-20
      • Percona XtraBackup 8.0.27-19
      • Percona XtraBackup 8.0.26-18.0
      • Percona XtraBackup 8.0.25-17.0
      • Percona XtraBackup 8.0.23-16.0
      • Percona XtraBackup 8.0.22-15.0
      • Percona XtraBackup 8.0.14
      • Percona XtraBackup 8.0.13
      • Percona XtraBackup 8.0.12
      • Percona XtraBackup 8.0.11
      • Percona XtraBackup 8.0.10
      • Percona XtraBackup 8.0.9
      • Percona XtraBackup 8.0.8
      • Percona XtraBackup 8.0.7
      • Percona XtraBackup 8.0.6
      • Percona XtraBackup 8.0.5
      • Percona XtraBackup 8.0.4
      • Percona XtraBackup 8.0-3-rc1
      • Error Message: Found tables with row versions due to INSTANT ADD/DROP columns
      • The xtrabackup option reference
      • The xbcrypt binary
      • The xbstream binary
      • Frequently asked questions
      • Glossary
      • Index of files created by Percona XtraBackup
      • Trademark policy
      • Copyright and licensing information
      • Version checking

    • Install the component
    • Use page tracking
    • Start page tracking manually
    • Check the LSN value
    • Stop page tracking
    • Purge page tracking data
    • Known issue
    • Uninstall the mysqlbackup component

    Take an incremental backup using page tracking¶

    Percona XtraBackup 8.0.27 adds support for page tracking functionality for an incremental backup.

    To create an incremental backup with page tracking, Percona XtraBackup uses the MySQL mysqlbackup component. This component provides a list of pages modified since the last backup, and Percona XtraBackup copies only those pages. This operation removes the need to scan the pages in the database. If the majority of pages have not been modified, the page tracking feature can improve the speed of incremental backups.

    Install the component¶

    To start using the page tracking functionality, do the following:

    1. Install the mysqlbackup component and enable it on the server:

      $ INSTALL COMPONENT "file://component_mysqlbackup";
      
    2. Check whether the mysqlbackup component is installed successfully:

      $ SELECT COUNT(1) FROM mysql.component WHERE component_urn='file://component_mysqlbackup';
      

    Use page tracking¶

    You can enable the page tracking functionality for the full and incremental backups with the --page-tracking option.

    The option has the following benefits:

    • Resets page tracking to the start of the backup. This reset allows the next incremental backup to use page tracking.

    • Allows the use of page tracking for an incremental backup if the page tracking data is available from the backup’s start checkpoint LSN.

    Percona XtraBackup processes a list of all the tracked pages in memory. If Percona XtraBackup does not have enough available memory to process this list, the process throws an error and exits. For example, if an incremental backup uses 200GB, Percona XtraBackup can use an additional 100MB of memory to process and store the page tracking data.

    The examples of creating full and incremental backups using the --page-tracking option:

    $ xtrabackup --backup --target-dir=$FULL_BACK --page-tracking
    
    $ xtrabackup --backup --target-dir=$INC_BACKUP  
    --incremental-basedir=$FULL_BACKUP --page-tracking
    

    After enabling the functionality, the next incremental backup finds changed pages using page tracking.

    The first full backup using page tracking, Percona XtraBackup may have a delay. The following is an example of the message:

    Expected output
    xtrabackup: pagetracking: Sleeping for 1 second, waiting for checkpoint lsn 17852922 /
    to reach to page tracking start lsn 21353759
    

    Enable page tracking before creating the first backup to avoid this delay. This method ensures that the page tracking log sequence number (LSN) is higher than the checkpoint LSN of the server.

    Start page tracking manually¶

    After the mysqlbackup component is loaded and active on the server, you can start page tracking manually with the following option:

    $ SELECT mysqlbackup_page_track_set(true);
    

    Check the LSN value¶

    Check the LSN value starting from which changed pages are tracked with the following option:

    $ SELECT mysqlbackup_page_track_get_start_lsn();
    

    Stop page tracking¶

    To stop page tracking, use the following command:

    $ SELECT mysqlbackup_page_track_set(false);
    

    Purge page tracking data¶

    When you start page tracking, it creates a file under the server’s datadir to collect data about changed pages. This file grows until you stop the page tracking. If you stop the server and then restart it, page tracking creates a new file but also keeps the old one. The old file continues to grow until you stop the page tracking explicitly.

    If you purge the page tracking data, you should create a full backup afterward. To purge the page tracking data, do the following steps:

    $ SELECT mysqlbackup_page_track_set(false);
    $ SELECT mysqlbackup_page_track_purge_up_to(9223372036854775807);
    /* Specify the LSN up to which you want to purge page tracking data. /
    9223372036854775807 is the highest possible LSN which purges all page tracking files.*/
    $ SELECT mysqlbackup_page_track_set(true);
    

    Known issue¶

    If the index is built in place using an exclusive algorithm and then is added to a table after the last LSN checkpoint, you may generate a bad incremental backup using page tracking. For more details see PS-8032.

    Uninstall the mysqlbackup component¶

    To uninstall the mysqlbackup component, use the following statement:

    $ UNINSTALL COMPONENT "file://component_mysqlbackup"
    

    Contact us

    For free technical help, visit the Percona Community Forum.

    To report bugs or submit feature requests, open a JIRA ticket.

    For paid support and managed or consulting services , contact Percona Sales.


    Last update: 2022-12-06
    Back to top
    Previous lock-ddl-per-table option improvements
    Next The xbcloud binary
    Percona LLC and/or its affiliates, © 2023
    Made with Material for MkDocs