I just found an interesting behavior when using the mysqlbackup feature to create a backup of a database and I'm wondering if I missed any steps or maybe a config that I missed or created a typo somewhere.
When running the following command:
/path/to/mysql_enterprise_backup/bin/mysqlbackup --host=127.0.0.1 \
--user=$BACKUP_USER --password=$BACKUP_PASS --include-tables="^\*.\*$" \
--with-timestamp --use-tts --backup-dir=$BACKUP_DIR --compress \
backup-and-apply-log
I get an error at the end of the script:
InnoDB: Progress in percent: 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 210120 09:53:45 PCR1
INFO: We were able to parse ibbackup_logfile up to lsn 31466657750. 210120 09:53:45 MAIN INFO: Apply-log-compress operation completed successfully. 210120 09:53:45 MAIN INFO: Full backup prepared for recovery successfully.MAIN: Can't get stat of '/path/to/backup/hotbackups/2021-01-20_09-51-53/datadir/ibdata1' (Errcode: 2 - No such file or directory) 210120 09:53:45 MAIN ERROR: Unable to get the size of file /path/to/backup/hotbackups/2021-01-20_09-51-53/datadir/ibdata1. Error code: 2, No such file or directory
mysqlbackup failed with errors!
As per the error, the script attempts to get the size of the ibdata1
file, but it can't find it and fails.
The only items available in the datadir
directory are my schemas and ibbackup_logfile
, but not ibdata1
.
Now this is where it gets interesting and also where I'm getting lost.
I'm using the --use-tts
option when creating my backup (in order to be selective and restore in another environment) but looking at the doc for the --use-tts
option, and I quote:
The system tablespace is not backed up, saving disk space and I/O resources
With this in mind, if I understand correctly, the --use-tts
option will not backup and create the ibdata
file but the command mysqlbackup
will still check for that specific file even though the option to not create it has been specified in the command.
This is causing the backup to get the fail message.
My dilemma at this time is that the mysqlbackup
command fails even though my backup seems to have been done correctly. (I'm assuming it was done correctly because of this log entry: "210120 09:53:45 MAIN INFO: Full backup prepared for recovery successfully.")
Has anyone noticed this before?