Skip to content

Commit

Permalink
Adopting to changes made by PR-349
Browse files Browse the repository at this point in the history
  • Loading branch information
codeforall committed Nov 22, 2024
1 parent fe02246 commit f0199ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/access/pg_tde_xlog.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ tdeheap_rmgr_desc(StringInfo buf, XLogReaderState *record)
{
TDEPrincipalKeyInfo *xlrec = (TDEPrincipalKeyInfo *) XLogRecGetData(record);

appendStringInfo(buf, "Alter key provider to:%d for tde principal key for db %u/%u", xlrec->keyringId, xlrec->databaseId, xlrec->tablespaceId);
appendStringInfo(buf, "Alter key provider to:%d for tde principal key for db %u", xlrec->keyringId, xlrec->databaseId);
}
if (info == XLOG_TDE_EXTENSION_INSTALL_KEY)
{
Expand Down
13 changes: 6 additions & 7 deletions src/catalog/tde_principal_key.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static TDEPrincipalKey *set_principal_key_with_keyring(const char *key_name,
GenericKeyring *keyring,
Oid dbOid,
bool ensure_new_key);
static TDEPrincipalKey *alter_keyprovider_for_principal_key(GenericKeyring *newKeyring,Oid dbOid, Oid spcOid);
static TDEPrincipalKey *alter_keyprovider_for_principal_key(GenericKeyring *newKeyring,Oid dbOid);

static const TDEShmemSetupRoutine principal_key_info_shmem_routine = {
.init_shared_state = initialize_shared_state,
Expand Down Expand Up @@ -308,8 +308,7 @@ set_principal_key_with_keyring(const char *key_name, GenericKeyring *keyring,
* alter_keyprovider_for_principal_key:
*/
TDEPrincipalKey *
alter_keyprovider_for_principal_key(GenericKeyring *newKeyring,
Oid dbOid, Oid spcOid)
alter_keyprovider_for_principal_key(GenericKeyring *newKeyring, Oid dbOid)
{
TDEPrincipalKeyInfo *principalKeyInfo = NULL;
TDEPrincipalKey *principal_key = NULL;
Expand All @@ -319,7 +318,7 @@ alter_keyprovider_for_principal_key(GenericKeyring *newKeyring,
Assert(newKeyring != NULL);
LWLockAcquire(lock_files, LW_EXCLUSIVE);

principalKeyInfo = pg_tde_get_principal_key_info(dbOid, spcOid);
principalKeyInfo = pg_tde_get_principal_key_info(dbOid);

if (principalKeyInfo == NULL)
{
Expand Down Expand Up @@ -352,7 +351,7 @@ alter_keyprovider_for_principal_key(GenericKeyring *newKeyring,
/* clear the cache as well */
clear_principal_key_cache(dbOid);

principal_key = GetPrincipalKey(dbOid, spcOid, LW_EXCLUSIVE);
principal_key = GetPrincipalKey(dbOid, LW_EXCLUSIVE);

LWLockRelease(lock_files);

Expand All @@ -373,8 +372,8 @@ SetPrincipalKey(const char *key_name, const char *provider_name, bool ensure_new
bool
AlterPrincipalKeyKeyring(const char *provider_name)
{
TDEPrincipalKey *principal_key = alter_keyprovider_for_principal_key(GetKeyProviderByName(provider_name, MyDatabaseId, MyDatabaseTableSpace),
MyDatabaseId, MyDatabaseTableSpace);
TDEPrincipalKey *principal_key = alter_keyprovider_for_principal_key(GetKeyProviderByName(provider_name, MyDatabaseId),
MyDatabaseId);

return (principal_key != NULL);
}
Expand Down

0 comments on commit f0199ba

Please sign in to comment.