Skip to content

[trunk] PXB-3571 : --transition-key does not save keys with --lock-ddl=reduced - #1687

Merged
satya-bodapati merged 3 commits into
percona:trunkfrom
satya-bodapati:PXB-trunk-3571
Jul 31, 2025
Merged

[trunk] PXB-3571 : --transition-key does not save keys with --lock-ddl=reduced #1687
satya-bodapati merged 3 commits into
percona:trunkfrom
satya-bodapati:PXB-trunk-3571

Conversation

@satya-bodapati

Copy link
Copy Markdown
Contributor

No description provided.

@satya-bodapati satya-bodapati self-assigned this Jul 30, 2025
Problem:
--------
If --transition-key is used with reduced lock backups (--lock-ddl=reduced),
it doesn't save the tablespace encryption key of all tablespaces.

This is because, as part of reduced lock, we close all tablespaces and re-open
only the tablespaces that are involved in DDLs. See handle_ddl_operations().

Later, we iterate over the in-memory list of tablespaces and save the keys.
Since the DDL tracker closed and removed all the tablespaces, it will now save
only the keys of tablespaces opened by DDL tracker.

Fix:
----
We now divide the tablespace keys into multiple stages. The old xb_tablespace_keys_dump()
is now refactored to TablespaceKeyDumper and functionality is split as below:

1. Saving keys from in-memory list: This is split into two phases. We do once
before tablespaces are removed from cache. And again, at the end for the new
tablespace discovered by reduced lock. This is dump_from_spaces()

2. Saving keys from redo: This can be done only after redo thread is stopped.
So it is done at end. This is dump_from_redo().

3. Saving keys from encryption_infos. This encryption_infos contains the keys
discovered for encrypted redo log. This is done as usual at end. The function that
does this is dump_from_encryption_infos()
@satya-bodapati
satya-bodapati merged commit f342b48 into percona:trunk Jul 31, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant