diff --git a/contrib/pg_tde/src/access/pg_tde_tdemap.c b/contrib/pg_tde/src/access/pg_tde_tdemap.c index 38c370bb84c..b0b7fd97267 100644 --- a/contrib/pg_tde/src/access/pg_tde_tdemap.c +++ b/contrib/pg_tde/src/access/pg_tde_tdemap.c @@ -764,7 +764,7 @@ pg_tde_perform_rotate_key(TDEPrincipalKey *principal_key, TDEPrincipalKey *new_p /* Insert the XLog record */ XLogBeginInsert(); XLogRegisterData((char *) xlrec, xlrec_size); - XLogInsert(RM_TDERMGR_ID, XLOG_TDE_ROTATE_KEY); + XLogInsert(RM_TDERMGR_ID, XLOG_TDE_ROTATE_PRINCIPAL_KEY); pfree(xlrec); diff --git a/contrib/pg_tde/src/access/pg_tde_xlog.c b/contrib/pg_tde/src/access/pg_tde_xlog.c index d80edf1d8ca..083006dfb0e 100644 --- a/contrib/pg_tde/src/access/pg_tde_xlog.c +++ b/contrib/pg_tde/src/access/pg_tde_xlog.c @@ -60,25 +60,25 @@ tdeheap_rmgr_redo(XLogReaderState *record) pg_tde_save_principal_key_redo(mkey); } - else if (info == XLOG_TDE_EXTENSION_INSTALL_KEY) + else if (info == XLOG_TDE_INSTALL_EXTENSION) { XLogExtensionInstall *xlrec = (XLogExtensionInstall *) XLogRecGetData(record); extension_install_redo(xlrec); } - else if (info == XLOG_TDE_ADD_KEY_PROVIDER_KEY) + else if (info == XLOG_TDE_WRITE_KEY_PROVIDER) { KeyringProviderXLRecord *xlrec = (KeyringProviderXLRecord *) XLogRecGetData(record); redo_key_provider_info(xlrec); } - else if (info == XLOG_TDE_ROTATE_KEY) + else if (info == XLOG_TDE_ROTATE_PRINCIPAL_KEY) { XLogPrincipalKeyRotate *xlrec = (XLogPrincipalKeyRotate *) XLogRecGetData(record); xl_tde_perform_rotate_key(xlrec); } - else if (info == XLOG_TDE_FREE_MAP_ENTRY) + else if (info == XLOG_TDE_REMOVE_RELATION_KEY) { RelFileLocator *xlrec = (RelFileLocator *) XLogRecGetData(record); @@ -107,25 +107,25 @@ tdeheap_rmgr_desc(StringInfo buf, XLogReaderState *record) appendStringInfo(buf, "db: %u", xlrec->databaseId); } - else if (info == XLOG_TDE_EXTENSION_INSTALL_KEY) + else if (info == XLOG_TDE_INSTALL_EXTENSION) { XLogExtensionInstall *xlrec = (XLogExtensionInstall *) XLogRecGetData(record); appendStringInfo(buf, "db: %u", xlrec->database_id); } - else if (info == XLOG_TDE_ROTATE_KEY) + else if (info == XLOG_TDE_ROTATE_PRINCIPAL_KEY) { XLogPrincipalKeyRotate *xlrec = (XLogPrincipalKeyRotate *) XLogRecGetData(record); appendStringInfo(buf, "db: %u", xlrec->databaseId); } - else if (info == XLOG_TDE_ADD_KEY_PROVIDER_KEY) + else if (info == XLOG_TDE_WRITE_KEY_PROVIDER) { KeyringProviderXLRecord *xlrec = (KeyringProviderXLRecord *) XLogRecGetData(record); appendStringInfo(buf, "db: %u, provider id: %d", xlrec->database_id, xlrec->provider.provider_id); } - else if (info == XLOG_TDE_FREE_MAP_ENTRY) + else if (info == XLOG_TDE_REMOVE_RELATION_KEY) { RelFileLocator *xlrec = (RelFileLocator *) XLogRecGetData(record); @@ -142,14 +142,14 @@ tdeheap_rmgr_identify(uint8 info) return "ADD_RELATION_KEY"; case XLOG_TDE_ADD_PRINCIPAL_KEY: return "ADD_PRINCIPAL_KEY"; - case XLOG_TDE_EXTENSION_INSTALL_KEY: - return "EXTENSION_INSTALL_KEY"; - case XLOG_TDE_ROTATE_KEY: - return "ROTATE_KEY"; - case XLOG_TDE_ADD_KEY_PROVIDER_KEY: - return "ADD_KEY_PROVIDER_KEY"; - case XLOG_TDE_FREE_MAP_ENTRY: - return "FREE_MAP_ENTRY"; + case XLOG_TDE_INSTALL_EXTENSION: + return "INSTALL_EXTENSION"; + case XLOG_TDE_ROTATE_PRINCIPAL_KEY: + return "ROTATE_PRINCIPAL_KEY"; + case XLOG_TDE_WRITE_KEY_PROVIDER: + return "WRITE_KEY_PROVIDER"; + case XLOG_TDE_REMOVE_RELATION_KEY: + return "REMOVE_RELATION_KEY"; default: return NULL; } diff --git a/contrib/pg_tde/src/catalog/tde_keyring.c b/contrib/pg_tde/src/catalog/tde_keyring.c index b7937f568e3..0eb726352d5 100644 --- a/contrib/pg_tde/src/catalog/tde_keyring.c +++ b/contrib/pg_tde/src/catalog/tde_keyring.c @@ -512,7 +512,7 @@ write_key_provider_info(KeyringProviderRecord *provider, Oid database_id, XLogBeginInsert(); XLogRegisterData((char *) &xlrec, sizeof(KeyringProviderXLRecord)); - XLogInsert(RM_TDERMGR_ID, XLOG_TDE_ADD_KEY_PROVIDER_KEY); + XLogInsert(RM_TDERMGR_ID, XLOG_TDE_WRITE_KEY_PROVIDER); #else Assert(0); #endif diff --git a/contrib/pg_tde/src/include/access/pg_tde_xlog.h b/contrib/pg_tde/src/include/access/pg_tde_xlog.h index 22b8bd91160..ec1a3bbc72f 100644 --- a/contrib/pg_tde/src/include/access/pg_tde_xlog.h +++ b/contrib/pg_tde/src/include/access/pg_tde_xlog.h @@ -16,10 +16,10 @@ /* TDE XLOG resource manager */ #define XLOG_TDE_ADD_RELATION_KEY 0x00 #define XLOG_TDE_ADD_PRINCIPAL_KEY 0x10 -#define XLOG_TDE_EXTENSION_INSTALL_KEY 0x20 -#define XLOG_TDE_ROTATE_KEY 0x30 -#define XLOG_TDE_ADD_KEY_PROVIDER_KEY 0x40 -#define XLOG_TDE_FREE_MAP_ENTRY 0x50 +#define XLOG_TDE_INSTALL_EXTENSION 0x20 +#define XLOG_TDE_ROTATE_PRINCIPAL_KEY 0x30 +#define XLOG_TDE_WRITE_KEY_PROVIDER 0x40 +#define XLOG_TDE_REMOVE_RELATION_KEY 0x50 /* ID 140 is registered for Percona TDE extension: https://wiki.postgresql.org/wiki/CustomWALResourceManagers */ #define RM_TDERMGR_ID 140 diff --git a/contrib/pg_tde/src/pg_tde.c b/contrib/pg_tde/src/pg_tde.c index 34fd1b87206..aedb8eb6994 100644 --- a/contrib/pg_tde/src/pg_tde.c +++ b/contrib/pg_tde/src/pg_tde.c @@ -147,7 +147,7 @@ pg_tde_extension_initialize(PG_FUNCTION_ARGS) */ XLogBeginInsert(); XLogRegisterData((char *) &xlrec, sizeof(XLogExtensionInstall)); - XLogInsert(RM_TDERMGR_ID, XLOG_TDE_EXTENSION_INSTALL_KEY); + XLogInsert(RM_TDERMGR_ID, XLOG_TDE_INSTALL_EXTENSION); PG_RETURN_NULL(); }