Skip to content

PG-1411 Make pg_resetwal work with TDE #476

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 1, 2025

Conversation

artemgavrilov
Copy link
Collaborator

@artemgavrilov artemgavrilov commented Jul 18, 2025

https://perconadev.atlassian.net/browse/PG-1411

The only thing that differs in pg_resetwal for TDE setups is that it performs WAL key rotation the same way as server itself on startup. During this rotation pg_resetwal always create unecrypted type of key as WAL will contain only one record that don't contain anything sensitive. So no need actually encrypt anything yet. On startup server will create new key with proper type.

@artemgavrilov artemgavrilov force-pushed the PG-1411-pg_resetwal branch 2 times, most recently from f29751d to 763b096 Compare July 24, 2025 15:47
@artemgavrilov artemgavrilov marked this pull request as ready for review July 24, 2025 16:14
@artemgavrilov artemgavrilov requested a review from dutow as a code owner July 24, 2025 16:14
@artemgavrilov artemgavrilov requested a review from dAdAbird July 24, 2025 16:14
@codecov-commenter
Copy link

codecov-commenter commented Jul 29, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.78%. Comparing base (f631753) to head (d70f2c9).

❌ Your project status has failed because the head coverage (81.78%) 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     #476      +/-   ##
=====================================================
+ Coverage              81.75%   81.78%   +0.03%     
=====================================================
  Files                     24       24              
  Lines                   2987     2987              
  Branches                 485      485              
=====================================================
+ Hits                    2442     2443       +1     
+ Misses                   444      443       -1     
  Partials                 101      101              
Components Coverage Δ
access 81.36% <ø> (+0.19%) ⬆️
catalog 87.85% <ø> (ø)
common 77.77% <ø> (ø)
encryption 73.45% <ø> (ø)
keyring 73.21% <ø> (ø)
src 94.15% <ø> (ø)
smgr 94.85% <ø> (ø)
transam ∅ <ø> (∅)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@artemgavrilov artemgavrilov requested a review from dutow July 29, 2025 08:48
@artemgavrilov artemgavrilov force-pushed the PG-1411-pg_resetwal branch 2 times, most recently from 2e51b72 to 7b5e387 Compare July 30, 2025 17:03
@artemgavrilov artemgavrilov requested a review from dAdAbird July 30, 2025 17:09
Copy link
Member

@dAdAbird dAdAbird left a comment

Choose a reason for hiding this comment

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

a bit more comment nitpicking)

As pg_resetwal removes old WAL segments and creates new one with empty
record we can do that write in unencrypted mode. However that requires
new WAL key creation in case if encryption was enabled before.
These tests are copy of original pg_resetwal tests with enalbed WAL
encryption and removed flags validation as we interested here only in
proper enrypted WAL handling.
@artemgavrilov artemgavrilov merged commit 342122c into TDE_REL_17_STABLE Aug 1, 2025
18 of 19 checks passed
@artemgavrilov artemgavrilov deleted the PG-1411-pg_resetwal branch August 1, 2025 12:07
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.

4 participants