Skip to content

Add support for restoring encrypted backup - #2359

Open
yashdaga-24 wants to merge 3 commits into
percona:mainfrom
yashdaga-24:add-support-for-restoring-encrypted-backup
Open

Add support for restoring encrypted backup#2359
yashdaga-24 wants to merge 3 commits into
percona:mainfrom
yashdaga-24:add-support-for-restoring-encrypted-backup

Conversation

@yashdaga-24

@yashdaga-24 yashdaga-24 commented Feb 9, 2026

Copy link
Copy Markdown

CHANGE DESCRIPTION

Problem:
Restore operations fail when backups contain tables encrypted using file-based keyring components (component_keyring_file). The recovery scripts only support vault-based keyring configurations and do not detect or handle file-based keyring component configurations, causing restore and prepare jobs to fail with keyring-related errors.

Cause:
Short explanation of the root cause of the issue if applicable.

Solution:
Update the recovery scripts to properly detect and support file-based keyring components:

  1. Check for component_keyring_file.cnf in addition to vault config file
  2. Implement content-based detection: parse the config file to determine if it's a component config (JSON format with "path" key) or plugin config (INI format with vault_url key)
  3. Use appropriate XtraBackup flags based on detected keyring type:
    Component mode: --component-keyring-config
    Plugin mode: --keyring-vault-config with --early-plugin-load
  4. Support both XtraBackup 8.0.25+ (which supports components) and 8.4.0+ (which always uses components)

CHECKLIST

Jira

  • Is the Jira ticket created and referenced properly?
  • Does the Jira ticket have the proper statuses for documentation (Needs Doc) and QA (Needs QA)?
  • Does the Jira ticket link to the proper milestone (Fix Version field)?

Tests

  • Is an E2E test/test case added for the new feature/change?
  • Are unit tests added where appropriate?
  • Are OpenShift compare files changed for E2E tests (compare/*-oc.yml)?

Config/Logging/Testability

  • Are all needed new/changed options added to default YAML files?
  • Are all needed new/changed options added to the Helm Chart?
  • Did we add proper logging messages for operator actions?
  • Did we ensure compatibility with the previous version or cluster upgrade process?
  • Does the change support oldest and newest supported PXC version?
  • Does the change support oldest and newest supported Kubernetes version?

@it-percona-cla

it-percona-cla commented Feb 9, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@pull-request-size pull-request-size Bot added the size/XXL 1000+ lines label Feb 9, 2026

@egegunes egegunes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see a lot of unrelated changes. @yashdaga-24 could you please rebase your branch to main? And please add a description of your changes.

@yashdaga-24

yashdaga-24 commented Feb 10, 2026

Copy link
Copy Markdown
Author

Hi @egegunes, Sorry I hadn't meant to raise it for review, I just raised it to share the changes to someone from our team.

I'll break this and raise 2 separate PRs

1)Add extraPVC to restore pod.
2)Support restore job for tables encrypted using keyring component file if the keyring config file is located in xtrabackup container either in a hardcoded dir or we can allow an arg for it's location.

From my understanding currently keyring component is only handled for vault and not for file based and that too for pxc>=8.4. So I wanted to ask if you would want to merge the second PR?

@egegunes

Copy link
Copy Markdown
Contributor

From my understanding currently keyring component is only handled for vault and not for file based and that too for pxc>=8.4. So I wanted to ask if you would want to merge the second PR?

I don't see any reason to not merge it. @hors wdyt?

But please keep in mind that we have two different backup implementations: SST and XtrabackupSidecar. This needs to be implemented in both.

@yashdaga-24
yashdaga-24 force-pushed the add-support-for-restoring-encrypted-backup branch from 1d3d2eb to e2b445c Compare February 10, 2026 06:35
@pull-request-size pull-request-size Bot added size/M 30-99 lines and removed size/XXL 1000+ lines labels Feb 10, 2026
- Add auto-detection for component keyring configs in recovery scripts
- Check for component_keyring_file.cnf in addition to vault config
- Detect component vs plugin based on config file content ("path" key for component, "vault_url" for plugin)
- Support XtraBackup 8.0.25+ with component-based keyring
- Support XtraBackup 8.4.0+ which always uses components
@yashdaga-24
yashdaga-24 force-pushed the add-support-for-restoring-encrypted-backup branch from e2b445c to 854cf21 Compare February 10, 2026 06:51
@yashdaga-24

yashdaga-24 commented Feb 10, 2026

Copy link
Copy Markdown
Author

Hi @egegunes

I've raised #2361 for adding extraPVC to restore job and kept the component keyring file support here.

@egegunes egegunes added this to the v1.20.0 milestone Feb 11, 2026
@JNKPercona

Copy link
Copy Markdown
Collaborator
Test Name Result Time
auto-tuning-8-0 passed 00:22:25
allocator-8-0 passed 00:15:13
allocator-8-4 passed 00:14:25
backup-storage-tls-8-0 passed 00:24:17
cross-site-8-0 passed 00:39:49
cross-site-proxysql-8-0 passed 00:43:49
cross-site-proxysql-8-4 passed 00:44:17
custom-users-8-0 passed 00:15:12
demand-backup-cloud-8-0 passed 01:02:41
demand-backup-cloud-8-4 passed 01:02:54
demand-backup-cloud-pxb-8-0 failure 00:37:10
demand-backup-encrypted-with-tls-5-7 passed 00:50:35
demand-backup-encrypted-with-tls-8-0 passed 00:50:23
demand-backup-encrypted-with-tls-8-4 failure 00:16:44
demand-backup-encrypted-with-tls-pxb-5-7 passed 00:21:19
demand-backup-encrypted-with-tls-pxb-8-0 passed 00:23:26
demand-backup-encrypted-with-tls-pxb-8-4 failure 00:17:05
demand-backup-8-0 failure 00:25:00
demand-backup-flow-control-8-0 passed 00:11:12
demand-backup-flow-control-8-4 passed 00:13:45
demand-backup-parallel-8-0 passed 00:12:49
demand-backup-parallel-8-4 passed 00:11:13
demand-backup-without-passwords-8-0 passed 00:21:10
demand-backup-without-passwords-8-4 passed 00:18:42
extra-pvc-8-0 passed 00:26:46
haproxy-5-7 passed 00:20:39
haproxy-8-0 passed 00:14:48
haproxy-8-4 passed 00:16:32
init-deploy-5-7 passed 00:21:35
init-deploy-8-0 passed 00:22:39
limits-8-0 passed 00:16:40
monitoring-2-0-8-0 passed 00:25:48
monitoring-pmm3-8-0 passed 00:23:03
monitoring-pmm3-8-4 passed 00:21:28
one-pod-5-7 passed 00:14:21
one-pod-8-0 passed 00:18:08
pitr-8-0 passed 01:08:32
pitr-8-4 passed 01:07:23
pitr-pxb-8-0 failure 00:34:04
pitr-pxb-8-4 passed 00:52:41
pitr-gap-errors-8-0 passed 00:58:35
pitr-gap-errors-8-4 passed 00:57:33
proxy-protocol-8-0 passed 00:12:01
proxy-switch-8-0 passed 00:15:04
proxysql-sidecar-res-limits-8-0 passed 00:11:07
proxysql-scheduler-8-0 failure 00:33:12
pvc-resize-5-7 passed 00:20:57
pvc-resize-8-0 passed 00:18:06
recreate-8-0 passed 00:25:34
restore-to-encrypted-cluster-8-0 passed 00:30:26
restore-to-encrypted-cluster-8-4 failure 00:19:51
restore-to-encrypted-cluster-pxb-8-0 passed 00:20:01
restore-to-encrypted-cluster-pxb-8-4 failure 00:14:26
scaling-proxysql-8-0 passed 00:13:42
scaling-8-0 passed 00:14:06
scheduled-backup-5-7 passed 01:04:00
scheduled-backup-8-0 passed 01:07:15
scheduled-backup-8-4 passed 01:08:06
security-context-8-0 passed 00:28:16
smart-update1-8-0 passed 00:36:28
smart-update1-8-4 passed 00:40:38
smart-update2-8-0 passed 00:46:15
smart-update2-8-4 passed 00:41:13
smart-update3-8-0 passed 00:17:50
sst-retry-limit-8-0 passed 00:16:44
sst-retry-limit-8-4 passed 00:18:34
storage-8-0 passed 00:14:26
tls-issue-cert-manager-ref-8-0 passed 00:12:09
tls-issue-cert-manager-8-0 failure 00:13:58
tls-issue-self-8-0 failure 00:27:17
upgrade-consistency-8-0 passed 00:17:46
upgrade-consistency-8-4 passed 00:17:01
upgrade-haproxy-5-7 passed 00:25:59
upgrade-haproxy-8-0 passed 00:27:17
upgrade-proxysql-5-7 passed 00:16:43
upgrade-proxysql-8-0 passed 00:16:44
users-5-7 passed 00:35:00
users-8-0 passed 00:30:53
users-scheduler-8-4 passed 00:29:05
validation-hook-8-0 passed 00:02:25
Summary Value
Tests Run 80/80
Job Duration 04:17:18
Total Test Time 37:18:03

commit: d9921a6
image: perconalab/percona-xtradb-cluster-operator:PR-2359-d9921a6c

@egegunes egegunes modified the milestones: v1.20.0, v1.21.0 Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants