mirror of
https://github.com/postgres/postgres.git
synced 2025-06-09 00:01:41 -04:00
PG-1441 Further improve resource manager type names
The type names were a a mess with diffeent naming convetions, e.g. KEY vs PRINCIPAL_KEY, so try to standardize on something sane.
This commit is contained in:
parent
33d78260c5
commit
ac53512847
@ -764,7 +764,7 @@ pg_tde_perform_rotate_key(TDEPrincipalKey *principal_key, TDEPrincipalKey *new_p
|
|||||||
/* Insert the XLog record */
|
/* Insert the XLog record */
|
||||||
XLogBeginInsert();
|
XLogBeginInsert();
|
||||||
XLogRegisterData((char *) xlrec, xlrec_size);
|
XLogRegisterData((char *) xlrec, xlrec_size);
|
||||||
XLogInsert(RM_TDERMGR_ID, XLOG_TDE_ROTATE_KEY);
|
XLogInsert(RM_TDERMGR_ID, XLOG_TDE_ROTATE_PRINCIPAL_KEY);
|
||||||
|
|
||||||
pfree(xlrec);
|
pfree(xlrec);
|
||||||
|
|
||||||
|
@ -60,25 +60,25 @@ tdeheap_rmgr_redo(XLogReaderState *record)
|
|||||||
|
|
||||||
pg_tde_save_principal_key_redo(mkey);
|
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);
|
XLogExtensionInstall *xlrec = (XLogExtensionInstall *) XLogRecGetData(record);
|
||||||
|
|
||||||
extension_install_redo(xlrec);
|
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);
|
KeyringProviderXLRecord *xlrec = (KeyringProviderXLRecord *) XLogRecGetData(record);
|
||||||
|
|
||||||
redo_key_provider_info(xlrec);
|
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);
|
XLogPrincipalKeyRotate *xlrec = (XLogPrincipalKeyRotate *) XLogRecGetData(record);
|
||||||
|
|
||||||
xl_tde_perform_rotate_key(xlrec);
|
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);
|
RelFileLocator *xlrec = (RelFileLocator *) XLogRecGetData(record);
|
||||||
|
|
||||||
@ -107,25 +107,25 @@ tdeheap_rmgr_desc(StringInfo buf, XLogReaderState *record)
|
|||||||
|
|
||||||
appendStringInfo(buf, "db: %u", xlrec->databaseId);
|
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);
|
XLogExtensionInstall *xlrec = (XLogExtensionInstall *) XLogRecGetData(record);
|
||||||
|
|
||||||
appendStringInfo(buf, "db: %u", xlrec->database_id);
|
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);
|
XLogPrincipalKeyRotate *xlrec = (XLogPrincipalKeyRotate *) XLogRecGetData(record);
|
||||||
|
|
||||||
appendStringInfo(buf, "db: %u", xlrec->databaseId);
|
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);
|
KeyringProviderXLRecord *xlrec = (KeyringProviderXLRecord *) XLogRecGetData(record);
|
||||||
|
|
||||||
appendStringInfo(buf, "db: %u, provider id: %d", xlrec->database_id, xlrec->provider.provider_id);
|
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);
|
RelFileLocator *xlrec = (RelFileLocator *) XLogRecGetData(record);
|
||||||
|
|
||||||
@ -142,14 +142,14 @@ tdeheap_rmgr_identify(uint8 info)
|
|||||||
return "ADD_RELATION_KEY";
|
return "ADD_RELATION_KEY";
|
||||||
case XLOG_TDE_ADD_PRINCIPAL_KEY:
|
case XLOG_TDE_ADD_PRINCIPAL_KEY:
|
||||||
return "ADD_PRINCIPAL_KEY";
|
return "ADD_PRINCIPAL_KEY";
|
||||||
case XLOG_TDE_EXTENSION_INSTALL_KEY:
|
case XLOG_TDE_INSTALL_EXTENSION:
|
||||||
return "EXTENSION_INSTALL_KEY";
|
return "INSTALL_EXTENSION";
|
||||||
case XLOG_TDE_ROTATE_KEY:
|
case XLOG_TDE_ROTATE_PRINCIPAL_KEY:
|
||||||
return "ROTATE_KEY";
|
return "ROTATE_PRINCIPAL_KEY";
|
||||||
case XLOG_TDE_ADD_KEY_PROVIDER_KEY:
|
case XLOG_TDE_WRITE_KEY_PROVIDER:
|
||||||
return "ADD_KEY_PROVIDER_KEY";
|
return "WRITE_KEY_PROVIDER";
|
||||||
case XLOG_TDE_FREE_MAP_ENTRY:
|
case XLOG_TDE_REMOVE_RELATION_KEY:
|
||||||
return "FREE_MAP_ENTRY";
|
return "REMOVE_RELATION_KEY";
|
||||||
default:
|
default:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -512,7 +512,7 @@ write_key_provider_info(KeyringProviderRecord *provider, Oid database_id,
|
|||||||
|
|
||||||
XLogBeginInsert();
|
XLogBeginInsert();
|
||||||
XLogRegisterData((char *) &xlrec, sizeof(KeyringProviderXLRecord));
|
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
|
#else
|
||||||
Assert(0);
|
Assert(0);
|
||||||
#endif
|
#endif
|
||||||
|
@ -16,10 +16,10 @@
|
|||||||
/* TDE XLOG resource manager */
|
/* TDE XLOG resource manager */
|
||||||
#define XLOG_TDE_ADD_RELATION_KEY 0x00
|
#define XLOG_TDE_ADD_RELATION_KEY 0x00
|
||||||
#define XLOG_TDE_ADD_PRINCIPAL_KEY 0x10
|
#define XLOG_TDE_ADD_PRINCIPAL_KEY 0x10
|
||||||
#define XLOG_TDE_EXTENSION_INSTALL_KEY 0x20
|
#define XLOG_TDE_INSTALL_EXTENSION 0x20
|
||||||
#define XLOG_TDE_ROTATE_KEY 0x30
|
#define XLOG_TDE_ROTATE_PRINCIPAL_KEY 0x30
|
||||||
#define XLOG_TDE_ADD_KEY_PROVIDER_KEY 0x40
|
#define XLOG_TDE_WRITE_KEY_PROVIDER 0x40
|
||||||
#define XLOG_TDE_FREE_MAP_ENTRY 0x50
|
#define XLOG_TDE_REMOVE_RELATION_KEY 0x50
|
||||||
|
|
||||||
/* ID 140 is registered for Percona TDE extension: https://wiki.postgresql.org/wiki/CustomWALResourceManagers */
|
/* ID 140 is registered for Percona TDE extension: https://wiki.postgresql.org/wiki/CustomWALResourceManagers */
|
||||||
#define RM_TDERMGR_ID 140
|
#define RM_TDERMGR_ID 140
|
||||||
|
@ -147,7 +147,7 @@ pg_tde_extension_initialize(PG_FUNCTION_ARGS)
|
|||||||
*/
|
*/
|
||||||
XLogBeginInsert();
|
XLogBeginInsert();
|
||||||
XLogRegisterData((char *) &xlrec, sizeof(XLogExtensionInstall));
|
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();
|
PG_RETURN_NULL();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user