aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/transam/clog.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-02-22 01:21:34 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2024-02-22 01:21:34 +0200
commit28f3915b73f75bd1b50ba070f56b34241fe53fd1 (patch)
tree10d305f3f98af6cfae7d683ce9b13c449d8e8796 /src/backend/access/transam/clog.c
parent4989ce72644b9d636b9b23c7a1719a405e62670b (diff)
downloadpostgresql-28f3915b73f75bd1b50ba070f56b34241fe53fd1.tar.gz
postgresql-28f3915b73f75bd1b50ba070f56b34241fe53fd1.zip
Remove superfluous 'pgprocno' field from PGPROC
It was always just the index of the PGPROC entry from the beginning of the proc array. Introduce a macro to compute it from the pointer instead. Reviewed-by: Andres Freund Discussion: https://www.postgresql.org/message-id/8171f1aa-496f-46a6-afc3-c46fe7a9b407@iki.fi
Diffstat (limited to 'src/backend/access/transam/clog.c')
-rw-r--r--src/backend/access/transam/clog.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/access/transam/clog.c b/src/backend/access/transam/clog.c
index 06fc2989bab..97f7434da34 100644
--- a/src/backend/access/transam/clog.c
+++ b/src/backend/access/transam/clog.c
@@ -425,6 +425,7 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status,
{
volatile PROC_HDR *procglobal = ProcGlobal;
PGPROC *proc = MyProc;
+ int pgprocno = MyProcNumber;
uint32 nextidx;
uint32 wakeidx;
@@ -458,7 +459,7 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status,
* less efficiently.
*/
if (nextidx != INVALID_PGPROCNO &&
- ProcGlobal->allProcs[nextidx].clogGroupMemberPage != proc->clogGroupMemberPage)
+ GetPGProcByNumber(nextidx)->clogGroupMemberPage != proc->clogGroupMemberPage)
{
/*
* Ensure that this proc is not a member of any clog group that
@@ -473,7 +474,7 @@ TransactionGroupUpdateXidStatus(TransactionId xid, XidStatus status,
if (pg_atomic_compare_exchange_u32(&procglobal->clogGroupFirst,
&nextidx,
- (uint32) proc->pgprocno))
+ (uint32) pgprocno))
break;
}