Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Pass proper old rlocator to smgr when creating relations and indexes #156

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 1 commit into from
Mar 21, 2025

Conversation

dAdAbird
Copy link
Member

Before this change, the smgr would decrypt indexes and relations when moving data to new files (VACUUM FULL, REINDEX CONCURRENTLY etc)

Fixes PG-1494, PG-1495, PG-1496

@dAdAbird dAdAbird requested review from jeltz and dutow March 21, 2025 15:20
Before this change, the smgr would decrypt indexes and relations when
moving data to new files (VACUUM FULL, REINDEX CONCURRENTLY etc)

Fixes PG-1494, PG-1495, PG-1496
Copy link
Collaborator

@dutow dutow left a comment

Choose a reason for hiding this comment

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

@jeltz the commit in the upstream patch will also need something along these changes, if we want to keep this part in it.

@@ -1283,6 +1303,12 @@ heap_create_with_catalog(const char *relname,
else
relacl = NULL;

if (relrewrite != InvalidOid)
{
old_rel = table_open(relrewrite, AccessShareLock);
Copy link
Collaborator

Choose a reason for hiding this comment

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

can't we close the table immediately here?

Copy link
Member Author

Choose a reason for hiding this comment

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

old_rel is a poiter to the shared buffer. We could do memcpy here but I think it is safer just to hold the lock while we are "referring" to the rel. The parallel process might for example delete this relation and then we may get in to trouble in smgrcteate

* table_relation_set_new_filelocator() takes old_rlocator from
* rel->rd_locator
*/
rel->rd_locator = prev_rlocator;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe it would be better to do this similarly to the OldOid in the heap create function, but this is a good workaround for now so that we can get the release progressing.

@dAdAbird dAdAbird merged commit e92fee7 into percona:release-17.4 Mar 21, 2025
14 checks passed
@dAdAbird dAdAbird deleted the vacuum_decrypt branch March 24, 2025 15:23
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