Skip to content

PROTOTYPE: tablespace based encryption#576

Draft
dutow wants to merge 1 commit into
percona:mainfrom
dutow:prototype/tablespace-encryption
Draft

PROTOTYPE: tablespace based encryption#576
dutow wants to merge 1 commit into
percona:mainfrom
dutow:prototype/tablespace-encryption

Conversation

@dutow
Copy link
Copy Markdown
Collaborator

@dutow dutow commented May 5, 2026

THIS IS A DRAFT/PROTOTYPE

Adds basic tablespace support on top of existing code. tde_heap is not marked as deprecated (yet)

Different related relations (e.g. table data and indexes) can have different encryption status, some can be on encrypted tablespace while others are plaintext.

Adds a helper function that list such objects, also used in the test suite.

Encryption marker for tablespaces is a single file in the pg_tde directory. A production implementation would need a bit more logic, this is kept simple as that wasn't the point of the prototype.

Most of the code is trivial additions, the tricky part is the crash safety/ordering of the tablespace marking functions.

Most of the commit is the test suite, code changes are relatively small. We'll definitely have to simplify that part if we want to go in this direction, for now it should be fine - let's focus on reviewing the code part :)

THIS IS A DRAFT/PROTOTYPE

Adds basic tablespace support on top of existing code.
tde_heap is not marked as deprecated (yet)

Different related relations (e.g. table data and indexes) can have
different encryption status, some can be on encrypted tablespace while
others are plaintext.

Adds a helper function that list such objects, also used in the test
suite.

Encryption marker for tablespaces is a single file in the pg_tde
directory. A production implementation would need a bit more logic, this
is kept simple as that wasn't the point of the prototype.

Most of the code is trivial additions, the tricky part is the crash
safety/ordering of the tablespace marking functions.

Most of the commit is the test suite, code changes are relatively small.
We'll definitely have to simplify that part if we want to go in this
direction, for now it should be fine - let's focus on reviewing the code
part :)
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 79.53795% with 62 lines in your changes missing coverage. Please review.
✅ Project coverage is 58.29%. Comparing base (540f28e) to head (cc8325b).
⚠️ Report is 3 commits behind head on main.

❌ Your project status has failed because the head coverage (76.56%) 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             @@
##             main     #576      +/-   ##
==========================================
+ Coverage   57.67%   58.29%   +0.62%     
==========================================
  Files          68       69       +1     
  Lines       10749    11048     +299     
  Branches     2647     2733      +86     
==========================================
+ Hits         6199     6440     +241     
- Misses       3280     3311      +31     
- Partials     1270     1297      +27     
Components Coverage Δ
access 81.44% <38.46%> (-0.29%) ⬇️
bin 63.76% <ø> (ø)
catalog 78.05% <ø> (-0.10%) ⬇️
common 79.50% <78.85%> (-8.73%) ⬇️
encryption 57.02% <ø> (ø)
keyring 65.55% <ø> (ø)
src 87.82% <90.16%> (+0.48%) ⬆️
smgr 89.63% <100.00%> (+0.09%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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