Skip to content

WIP: PG-1710 Create helpers for decrypting/encrypting archived WAL - #470

Closed
jeltz wants to merge 3 commits into
percona:TDE_REL_17_STABLEfrom
jeltz:tde/archive-restore-helpers
Closed

WIP: PG-1710 Create helpers for decrypting/encrypting archived WAL#470
jeltz wants to merge 3 commits into
percona:TDE_REL_17_STABLEfrom
jeltz:tde/archive-restore-helpers

Conversation

@jeltz

@jeltz jeltz commented Jul 14, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@jeltz
jeltz force-pushed the tde/archive-restore-helpers branch 4 times, most recently from 7d39ab5 to 7ce48b3 Compare July 14, 2025 23:45
@jeltz jeltz changed the title WIP: Create helpers for decrypting/encrypting archived WAL WIP: PG-1710 Create helpers for decrypting/encrypting archived WAL Jul 14, 2025
@jeltz
jeltz force-pushed the tde/archive-restore-helpers branch 5 times, most recently from 50e4ea2 to 21e81bc Compare July 15, 2025 08:27
@codecov-commenter

codecov-commenter commented Jul 15, 2025

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 63.97849% with 67 lines in your changes missing coverage. Please review.

Project coverage is 82.48%. Comparing base (a329aeb) to head (3c43928).

❌ Your project status has failed because the head coverage (82.48%) is below the target coverage (90.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@                  Coverage Diff                  @@
##           TDE_REL_17_STABLE     #470      +/-   ##
=====================================================
- Coverage              83.68%   82.48%   -1.21%     
=====================================================
  Files                     21       24       +3     
  Lines                   2771     2963     +192     
  Branches                 435      483      +48     
=====================================================
+ Hits                    2319     2444     +125     
- Misses                   368      421      +53     
- Partials                  84       98      +14     
Components Coverage Δ
access 81.17% <0.00%> (-1.10%) ⬇️
catalog 87.85% <ø> (ø)
common 77.77% <ø> (ø)
encryption 73.45% <ø> (ø)
keyring 73.21% <ø> (ø)
src 94.15% <ø> (+6.59%) ⬆️
smgr 94.85% <ø> (ø)
transam ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jeltz
jeltz force-pushed the tde/archive-restore-helpers branch 16 times, most recently from fae342d to 1be237a Compare July 16, 2025 13:35
jeltz added 3 commits July 25, 2025 04:14
Now that we will soon be adding more bianries having them at the top
level only makes things confusing for developers.
To support some common WAL archiving tools, e.g. PgBackRest, we
implement an archive_command and a restore_command which can wrap any
command and use pipe() to create fake file to either read from or wraite
to. The restore command makes sure to write encrypted files if WAL
encryption is enabled. It uses the fresh WAL key generated by the server
on the current start which works fine because we then just let the first
invokation of the restore command set the start LSN of the key.

For e.g. PgBackRest you would have the following commands:

  archive_command = 'pg_tde_archive_decrypt %o pgbackrest --stanza=tde archive-push %p'
  restore_command = 'pg_tde_restore_encrypt %f %p pgbackrest --stanza=tde archive-get %f "%p"'
@jeltz
jeltz force-pushed the tde/archive-restore-helpers branch from 1be237a to 3c43928 Compare July 25, 2025 02:23
@jeltz jeltz closed this Jul 25, 2025
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.

2 participants