Skip to content

Commit b413660

Browse files
committed
PXB-3762: xtrabackup --backup --transition-key crashes when undo tablespace key exists in redo only
JIRA URL: https://perconadev.atlassian.net/browse/PXB-3762 The encryption_info keys map has two phases: - --backup : producer. Keys are inserted from redo and dumped to xtrabackup_keys at end-of-backup. - --prepare : consumer. xtrabackup_keys is loaded into the map and looked up to set up encryption on each tablespace. xb_set_encryption() / xb_fetch_tablespace_key() are the consumer side and must only run at prepare time. Condition 2 in srv_undo_tablespace_read_encryption() gates this correctly with (use_dumped_tablespace_keys && !srv_backup_mode); Condition 1 was missing the !srv_backup_mode half. --transition-key sets use_dumped_tablespace_keys=true in both phases, so when redo carried an undo-encryption key newer than the on-disk undo page, --backup entered the consumer path against an empty map and ut_a(found) fired. Add !srv_backup_mode to Condition 1 to match Condition 2. During backup we now use the key already in recv_key (which is what gets inserted into the map anyway).
1 parent c6054e1 commit b413660

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

storage/innobase/srv/srv0start.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ static dberr_t srv_undo_tablespace_read_encryption(pfs_os_file_t fh,
392392

393393
if (found && recv_key->lsn >= page_lsn) {
394394
// Condition 1: Use key from redo if available and appropriate
395-
encryption_success = use_dumped_tablespace_keys
395+
encryption_success = (use_dumped_tablespace_keys && !srv_backup_mode)
396396
? load_key_from_dump()
397397
: set_encryption(recv_key->ptr, recv_key->iv);
398398
} else if (is_enc) {

0 commit comments

Comments
 (0)