PG-1923 WIP 256-bit encryption #583
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a WIP, and the main goal is to gather feedback on the storage of bigger (32-byte) keys.
The current _keys file format supposes 16-byte-long keys, and extending it would mean the migration for users. So I tried to keep the current format by splitting bigger (32-byte) keys into 16-byte blocks and storing them in two consecutive disk entries. The writes of such sequential entries happen in one go (as one write) to keep the atomicity of changes and not to end up in situations where the first part of the key is updated and then a crash happens, leaving the whole key in a broken state.
The code becomes more sophisticated, but it's a trade-off for the _keys format compatibility with the older versions.
It's a raw draft to test the idea.
What has to be improved:
So, yes, the main area I'd like your feedback on is changes in pg_tde_xlog_keys.c.
For later, proper PR, I'll split it into separate commits (or even PRs).