Use macro wrapper to access PGPROC data, which allow to improve compa… (#7607)

DESCRIPTION: Use macro wrapper to access PGPROC data, to improve compatibility with PostgreSQL forks.
pull/7609/head
Evgeny Nechayev 2024-05-28 03:39:13 +03:00 committed by GitHub
parent 553d5ba15d
commit fcc72d8a23
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 5 additions and 5 deletions

View File

@ -395,7 +395,7 @@ StoreAllActiveTransactions(Tuplestorestate *tupleStore, TupleDesc tupleDescripto
bool showCurrentBackendDetails = showAllBackends;
BackendData *currentBackend =
&backendManagementShmemData->backends[backendIndex];
PGPROC *currentProc = &ProcGlobal->allProcs[backendIndex];
PGPROC *currentProc = GetPGProcByNumber(backendIndex);
/* to work on data after releasing g spinlock to protect against errors */
uint64 transactionNumber = 0;
@ -420,7 +420,7 @@ StoreAllActiveTransactions(Tuplestorestate *tupleStore, TupleDesc tupleDescripto
}
Oid databaseId = currentBackend->databaseId;
int backendPid = ProcGlobal->allProcs[backendIndex].pid;
int backendPid = GetPGProcByNumber(backendIndex)->pid;
/*
* We prefer to use worker_query instead of distributedCommandOriginator in
@ -1279,7 +1279,7 @@ ActiveDistributedTransactionNumbers(void)
/* build list of starting procs */
for (int curBackend = 0; curBackend < MaxBackends; curBackend++)
{
PGPROC *currentProc = &ProcGlobal->allProcs[curBackend];
PGPROC *currentProc = GetPGProcByNumber(curBackend);
BackendData currentBackendData;
if (currentProc->pid == 0)

View File

@ -375,7 +375,7 @@ AssociateDistributedTransactionWithBackendProc(TransactionNode *transactionNode)
for (int backendIndex = 0; backendIndex < MaxBackends; ++backendIndex)
{
PGPROC *currentProc = &ProcGlobal->allProcs[backendIndex];
PGPROC *currentProc = GetPGProcByNumber(backendIndex);
BackendData currentBackendData;
/* we're not interested in processes that are not active or waiting on a lock */

View File

@ -559,7 +559,7 @@ BuildLocalWaitGraph(bool onlyDistributedTx)
/* build list of starting procs */
for (int curBackend = 0; curBackend < totalProcs; curBackend++)
{
PGPROC *currentProc = &ProcGlobal->allProcs[curBackend];
PGPROC *currentProc = GetPGProcByNumber(curBackend);
BackendData currentBackendData;
if (currentProc->pid == 0)