[MDEV-11536] Prepare must use original configuration for innodb-encrypt-log by default Created: 2016-12-10  Updated: 2016-12-11  Resolved: 2016-12-11

Status: Closed
Project: MariaDB Server
Component/s: Backup
Affects Version/s: 10.1.20
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Andrii Nikitin (Inactive) Assignee: Vladislav Vaintroub
Resolution: Incomplete Votes: 0
Labels: None


 Description   

For particular single environment DBA must be able to perform backup / restore with the same xtrabackup commands without regard whether encryption is enabled or not.

If backup is restored in different environment - some tweaks may be needed depending on source and destination configuration.

Thus original configuration for innodb-encrypt-log (and innodb-encrypt-tables) must be stored in backup-my.cnf and used during prepare by default.

Currently following scenarios are observed, which are incorrect when
a. innodb-encrypt-log is enabled in my.cnf, but not preserved in backup-my.cnf
b. xtrabackup --prepare doesn't look into global configuration in my.cnf, so generates logs without encryption (default innodb-encrypt-log is OFF).

SCENARIO A.
xtrabackup --copy-back restores logs without encryption in original environment. That means DBA must take extra - care and always provide corresponding innodb-encrypt-log to --prepare. (Which breaks rule above)

SCENARIO B.
xtrabackup --stats --datadir=/backupdir looks at global configuration in my.cnf and reports error "Redo log crypto: getting mysqld crypto key from key version failed".

SCENARIO C. (technically the same as A)
After --copy-back :
xtrabackup --stats --datadir=/datadir looks at global configuration in my.cnf and reports error "Redo log crypto: getting mysqld crypto key from key version failed", because logs are not encrypted

TLDR: To make sure that DBA may use the same xtrabackup commands in single particular environment without regard of encryption configuration - backup-my.cnf must preserve original values for innodb-encrypt-log, innodb-encrypt-tables and innodb-tablespaces-encryption



 Comments   
Comment by Vladislav Vaintroub [ 2016-12-10 ]

Prepare creates empty logs. Whether they are encrypted or not, is unimportant.
Prepare does not create new tables (yes, replaying redo logs could recreate tables, but their encryption status is preserved, if not, something would be very wrong with recovery). I do not see how this information in backup-my.cnf helps recovery, and if something is not critical for the recovery, it should not be in backup-my.cnf

Comment by Andrii Nikitin (Inactive) [ 2016-12-11 ]

OK, I was misled by error from --stats on restored datadir :
"Redo log crypto: getting mysqld crypto key from key version failed",

That lead me to incorrect conclusion that encryption on logs doesn't match settings.

Closing this bug as invalid, will open new one for --stats

Generated at Thu Feb 08 07:50:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.