mirror of https://github.com/citusdata/citus.git
pgprocno and lxid have been combined into a struct in PGPROC
Relevant PG commits: 28f3915b73f75bd1b50ba070f56b34241fe53fd1pg17_kickoff28f3915b73
ab355e3a88de745607f6dd4c21f0119b5c68f2adab355e3a88
024c521117579a6d356050ad3d78fdc95e44eefa024c521117
parent
ec9beb543c
commit
140a443287
|
@ -33,7 +33,7 @@
|
|||
#include "storage/spin.h"
|
||||
#include "utils/timestamp.h"
|
||||
|
||||
#include "pg_version_constants.h"
|
||||
#include "pg_version_compat.h"
|
||||
|
||||
#include "distributed/backend_data.h"
|
||||
#include "distributed/connection_management.h"
|
||||
|
@ -700,7 +700,7 @@ InitializeBackendData(const char *applicationName)
|
|||
|
||||
uint64 gpid = ExtractGlobalPID(applicationName);
|
||||
|
||||
MyBackendData = &backendManagementShmemData->backends[MyProc->pgprocno];
|
||||
MyBackendData = &backendManagementShmemData->backends[getProcNo_compat(MyProc)];
|
||||
|
||||
Assert(MyBackendData);
|
||||
|
||||
|
@ -1174,11 +1174,11 @@ CurrentDistributedTransactionNumber(void)
|
|||
void
|
||||
GetBackendDataForProc(PGPROC *proc, BackendData *result)
|
||||
{
|
||||
int pgprocno = proc->pgprocno;
|
||||
int pgprocno = getProcNo_compat(proc);
|
||||
|
||||
if (proc->lockGroupLeader != NULL)
|
||||
{
|
||||
pgprocno = proc->lockGroupLeader->pgprocno;
|
||||
pgprocno = getProcNo_compat(proc->lockGroupLeader);
|
||||
}
|
||||
|
||||
BackendData *backendData = &backendManagementShmemData->backends[pgprocno];
|
||||
|
@ -1198,7 +1198,8 @@ GetBackendDataForProc(PGPROC *proc, BackendData *result)
|
|||
void
|
||||
CancelTransactionDueToDeadlock(PGPROC *proc)
|
||||
{
|
||||
BackendData *backendData = &backendManagementShmemData->backends[proc->pgprocno];
|
||||
BackendData *backendData = &backendManagementShmemData->backends[getProcNo_compat(
|
||||
proc)];
|
||||
|
||||
/* backend might not have used citus yet and thus not initialized backend data */
|
||||
if (!backendData)
|
||||
|
@ -1330,7 +1331,7 @@ ActiveDistributedTransactionNumbers(void)
|
|||
LocalTransactionId
|
||||
GetMyProcLocalTransactionId(void)
|
||||
{
|
||||
return MyProc->lxid;
|
||||
return getLxid_compat(MyProc);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -23,6 +23,8 @@
|
|||
#include "utils/hsearch.h"
|
||||
#include "utils/timestamp.h"
|
||||
|
||||
#include "pg_version_compat.h"
|
||||
|
||||
#include "distributed/backend_data.h"
|
||||
#include "distributed/connection_management.h"
|
||||
#include "distributed/hash_helpers.h"
|
||||
|
@ -993,7 +995,7 @@ AllocWaitEdge(WaitGraph *waitGraph)
|
|||
static void
|
||||
AddProcToVisit(PROCStack *remaining, PGPROC *proc)
|
||||
{
|
||||
if (remaining->procAdded[proc->pgprocno])
|
||||
if (remaining->procAdded[getProcNo_compat(proc)])
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -1001,7 +1003,7 @@ AddProcToVisit(PROCStack *remaining, PGPROC *proc)
|
|||
Assert(remaining->procCount < TotalProcCount());
|
||||
|
||||
remaining->procs[remaining->procCount++] = proc;
|
||||
remaining->procAdded[proc->pgprocno] = true;
|
||||
remaining->procAdded[getProcNo_compat(proc)] = true;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -108,6 +108,9 @@ getStxstattarget_compat(HeapTuple tup)
|
|||
k) create_foreignscan_path(a, b, c, d, e, f, g, h, \
|
||||
i, j, k)
|
||||
|
||||
#define getProcNo_compat(a) (a->vxid.procNumber)
|
||||
#define getLxid_compat(a) (a->vxid.lxid)
|
||||
|
||||
#else
|
||||
|
||||
#include "access/htup_details.h"
|
||||
|
@ -139,6 +142,9 @@ getStxstattarget_compat(HeapTuple tup)
|
|||
k) create_foreignscan_path(a, b, c, d, e, f, g, h, \
|
||||
i, k)
|
||||
|
||||
#define getProcNo_compat(a) (a->pgprocno)
|
||||
#define getLxid_compat(a) (a->lxid)
|
||||
|
||||
#endif
|
||||
|
||||
#if PG_VERSION_NUM >= PG_VERSION_16
|
||||
|
|
Loading…
Reference in New Issue