Skip to content

PG-2381 Fix migration with empty files and entries#582

Merged
AndersAstrand merged 2 commits into
percona:release-2.2.0from
AndersAstrand:fix-migration-with-empty-files-and-entries
May 19, 2026
Merged

PG-2381 Fix migration with empty files and entries#582
AndersAstrand merged 2 commits into
percona:release-2.2.0from
AndersAstrand:fix-migration-with-empty-files-and-entries

Conversation

@AndersAstrand
Copy link
Copy Markdown
Collaborator

The reproduction script in this issue surfaced two issues. One with an empty key file that was created by VACUUM FULL, and one with empty entries in the key file created by DROP TABLE. None of these issues had anything to do with pg_tde_upgrade but could be triggered even by only upgrading pg_tde without changing postgresql version at all.

Some clusters will have key files that are 0 bytes, ie. doesn't even
have a header.

This happens for example when VACUUM FULL is run and an empty 0_keys is
created.

We should probably make sure it is not created, but right now clusters
in the wild will have the empty file so we need to not crash.
The previous code would try to decrypt empty slots in the file which
would fail.
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
⚠️ Please upload report for BASE (release-2.2.0@894bbc3). Learn more about missing BASE report.

Additional details and impacted files
@@               Coverage Diff                @@
##             release-2.2.0     #582   +/-   ##
================================================
  Coverage                 ?   57.61%           
================================================
  Files                    ?       68           
  Lines                    ?    10781           
  Branches                 ?     2659           
================================================
  Hits                     ?     6211           
  Misses                   ?     3291           
  Partials                 ?     1279           
Components Coverage Δ
access 81.35% <0.00%> (?)
bin 63.76% <0.00%> (?)
catalog 78.34% <0.00%> (?)
common 88.23% <0.00%> (?)
encryption 57.02% <0.00%> (?)
keyring 65.55% <0.00%> (?)
src 87.33% <0.00%> (?)
smgr 89.54% <0.00%> (?)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown

@rjd15372 rjd15372 left a comment

Choose a reason for hiding this comment

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

Please note that my knowledge about this is very limited. But the changes look fine.

@AndersAstrand AndersAstrand merged commit c60333b into percona:release-2.2.0 May 19, 2026
21 checks passed
@AndersAstrand AndersAstrand deleted the fix-migration-with-empty-files-and-entries branch May 19, 2026 15:01
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