[MDEV-33334] mariabackup does not always write encrypted files to backup location Created: 2024-01-30 Updated: 2024-01-31 |
|
| Status: | Needs Feedback |
| Project: | MariaDB Server |
| Component/s: | Backup |
| Affects Version/s: | 10.11.6 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Critical |
| Reporter: | Matthew Musgrove | Assignee: | Marko Mäkelä |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Alma Linux 8.9, Alma Linux 9.2 |
||
| Attachments: |
|
| Description |
|
When encryption at rest is enabled, actively updated InnoDB tables are not stored encrypted when creating backups with mariabackup --backup as evidenced by the following failure when trying to restore a single database and running `ALTER TABLE <table> IMPORT TABLESPACE;`: We have not modified /etc/my.cnf.d/enable_encryption.cnf and /etc/my.cnf has the following in the [mariadb] section: Backup command: Rsync command: Prepare command: Restore is done using the instructions found here: The `ALTER TABLE [table] IMPORT TABLESPACE;` fails if a table was actively being updated when the backup was created. We have verified that the .idb file contains a mix of encrypted and unencypted data by using the Linux strings command. Background on how it was reproduced: |
| Comments |
| Comment by Marko Mäkelä [ 2024-01-31 ] | |||||||||||||||||||||||||||
|
Based on this description, I would first guess that the encryption was not properly enabled when mariadb-backup was run. I believe that thanks to some format changes related to When it comes to mariadb-backup --prepare, the log record payload as well as the contents of the pages would be interpreted as garbage if the encryption parameters are incorrect. Applying the log might appear to succeed, but I have some doubts. Especially the application of the Could you please write a script that reproduces this problem and shows the exact steps that are needed for reproducing this? I checked our regression test mariabackup.incremental_encrypted, and it is invoking mariadb-backup in a similar way, with no additional parameters related to encryption. It is also using the file_key_management encryption plugin. What it is missing is an INSERT running concurrently with backup, and any use of ALTER TABLE…IMPORT TABLESPACE. | |||||||||||||||||||||||||||
| Comment by Matthew Musgrove [ 2024-01-31 ] | |||||||||||||||||||||||||||
|
Scp the attached tarball to /tmp on the test system and then SSH into said system.
After running the strings command, you'll be prompted to press any key to continue on to the restore. Tail end of the output from my last test run:
|