4

I am trying to set up an incremental backup solution for my MariaDB database (stored in MyISAM storage, which is listed as supported) using the included mariabackup tool (a version of xtrabackup).

The issue I'm having is that the 'incremental' backups are all identical in size to the primary full backup and to one another. The steps I am going through are as follows.

First, I make a full backup of the database:

mariabackup --backup --databases="database" --target-dir /some/place/backup/full/ \
    --user backupuser

This creates a full backup which can be successfully prepared and restored.

Next, I aattempt to make an incremental backup using the command:

mariabackup --backup --databases="database" --target-dir /some/place/backup/inc/1/ \
        --incremental-basedir /some/place/backup/full/ --user backupuser

This command runs without error but it creates a full backup, even though the from_lsn and to_lsn are both identical (the largest/latest lsn).

Regardless of whether the lsn has incremented since the last backup, the log always shows xtrabackup: Transaction log of lsn (x) to (x) was copied. where x is the database's current lsn number.

If no data has been entered in the database since the last backup, then looking at the xtrabackup_checkpoints files I see:

Full backup:

backup_type = full-backuped
from_lsn = 0
to_lsn = 1706249
last_lsn = 1706249
recover_binlog_info = 0

Incremental backups:

backup_type = incremental
from_lsn = 1706249
to_lsn = 1706249
last_lsn = 1706249
recover_binlog_info = 0

In this case the incremental backups seem like they should be copying no data over.

If the lsn has increased since the last backup, I see:

Full backup:

backup_type = full-backuped
from_lsn = 0
to_lsn = 1706249
last_lsn = 1706249
recover_binlog_info = 0

Incremental backups:

backup_type = incremental
from_lsn = 1706249
to_lsn = 1706269
last_lsn = 1706269
recover_binlog_info = 0

In this case it looks like it should be copying only 1706249 to 1706269, but it copies the entire db. What am I doing wrong?

5
  • How much time elapsed between the backups? How many rows do you think you inserted/updated/deleted?
    – Rick James
    Jul 9, 2018 at 19:04
  • @RickJames The behaviour is the same regardless of whether there are many records inserted, few or none. I have tested it in short time frames (minutes) and long time frames (hours). Jul 9, 2018 at 21:30
  • I also noted that my incremental backups are huge (almost same size as the full backup) even when there are no data that have been added. Did you find an explanation to this?
    – Matthew
    Apr 3, 2019 at 10:03
  • @Matthew Sadly no, I ended up writing a diff script to pull out the new stuff and reconstitute it when restoring from a backup. Apr 14, 2019 at 3:06
  • Perhaps you need to use the argument --extra-lsndir=/some/place/backup/full/ on base backup and the same on incremental? I found an xtrabackup script that I am using as a model and it does this
    – lolcode
    Apr 6, 2020 at 14:56

1 Answer 1

2

MyISAM tables are not transactional so they are copied in full with each incremental backup.

Not the answer you're looking for? Browse other questions tagged or ask your own question.