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

Skip to content

Rename relation key removal XLOG record type to match naming consistency #419

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
Jun 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion contrib/pg_tde/src/access/pg_tde_xlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ tdeheap_rmgr_redo(XLogReaderState *record)

pg_tde_save_principal_key_redo(mkey);
}
else if (info == XLOG_TDE_REMOVE_RELATION_KEY)
else if (info == XLOG_TDE_DELETE_RELATION_KEY)
{
XLogRelKey *xlrec = (XLogRelKey *) XLogRecGetData(record);

Expand Down Expand Up @@ -118,6 +118,12 @@ tdeheap_rmgr_desc(StringInfo buf, XLogReaderState *record)

appendStringInfo(buf, "db: %u", dbOid);
}
else if (info == XLOG_TDE_DELETE_RELATION_KEY)
{
XLogRelKey *xlrec = (XLogRelKey *) XLogRecGetData(record);

appendStringInfo(buf, "rel: %u/%u/%u", xlrec->rlocator.spcOid, xlrec->rlocator.dbOid, xlrec->rlocator.relNumber);
}
else if (info == XLOG_TDE_WRITE_KEY_PROVIDER)
{
KeyringProviderRecordInFile *xlrec = (KeyringProviderRecordInFile *) XLogRecGetData(record);
Expand All @@ -143,6 +149,8 @@ tdeheap_rmgr_identify(uint8 info)
return "ADD_PRINCIPAL_KEY";
case XLOG_TDE_ROTATE_PRINCIPAL_KEY:
return "ROTATE_PRINCIPAL_KEY";
case XLOG_TDE_DELETE_RELATION_KEY:
return "DELETE_RELATION_KEY";
case XLOG_TDE_DELETE_PRINCIPAL_KEY:
return "DELETE_PRINCIPAL_KEY";
case XLOG_TDE_WRITE_KEY_PROVIDER:
Expand Down
2 changes: 1 addition & 1 deletion contrib/pg_tde/src/include/access/pg_tde_xlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#define XLOG_TDE_ROTATE_PRINCIPAL_KEY 0x20
#define XLOG_TDE_WRITE_KEY_PROVIDER 0x30
#define XLOG_TDE_INSTALL_EXTENSION 0x40
#define XLOG_TDE_REMOVE_RELATION_KEY 0x50
#define XLOG_TDE_DELETE_RELATION_KEY 0x50
#define XLOG_TDE_DELETE_PRINCIPAL_KEY 0x60

/* ID 140 is registered for Percona TDE extension: https://wiki.postgresql.org/wiki/CustomWALResourceManagers */
Expand Down
2 changes: 1 addition & 1 deletion contrib/pg_tde/src/smgr/pg_tde_smgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ tde_smgr_delete_key(const RelFileLocatorBackend *smgr_rlocator)

XLogBeginInsert();
XLogRegisterData((char *) &xlrec, sizeof(xlrec));
XLogInsert(RM_TDERMGR_ID, XLOG_TDE_REMOVE_RELATION_KEY);
XLogInsert(RM_TDERMGR_ID, XLOG_TDE_DELETE_RELATION_KEY);
}

void
Expand Down