Commit 39081175 authored by Robert Haas's avatar Robert Haas

Revert "Use group updates when setting transaction status in clog."

This reverts commit ccce90b3.  This
optimization is unsafe, at least, of rollbacks and rollbacks to
savepoints, but I'm concerned there may be other problematic cases as
well.  Therefore, I've decided to revert this pending further
investigation.
parent f8f1430a
This diff is collapsed.
......@@ -176,7 +176,7 @@ static TwoPhaseStateData *TwoPhaseState;
/*
* Global transaction entry currently locked by us, if any.
*/
GlobalTransaction MyLockedGxact = NULL;
static GlobalTransaction MyLockedGxact = NULL;
static bool twophaseExitRegistered = false;
......
......@@ -186,7 +186,6 @@ InitProcGlobal(void)
ProcGlobal->walwriterLatch = NULL;
ProcGlobal->checkpointerLatch = NULL;
pg_atomic_init_u32(&ProcGlobal->procArrayGroupFirst, INVALID_PGPROCNO);
pg_atomic_init_u32(&ProcGlobal->clogGroupFirst, INVALID_PGPROCNO);
/*
* Create and initialize all the PGPROC structures we'll need. There are
......@@ -409,14 +408,6 @@ InitProcess(void)
/* Initialize wait event information. */
MyProc->wait_event_info = 0;
/* Initialize fields for group transaction status update. */
MyProc->clogGroupMember = false;
MyProc->clogGroupMemberXid = InvalidTransactionId;
MyProc->clogGroupMemberXidStatus = TRANSACTION_STATUS_IN_PROGRESS;
MyProc->clogGroupMemberPage = -1;
MyProc->clogGroupMemberLsn = InvalidXLogRecPtr;
pg_atomic_init_u32(&MyProc->clogGroupNext, INVALID_PGPROCNO);
/*
* Acquire ownership of the PGPROC's latch, so that we can use WaitLatch
* on it. That allows us to repoint the process latch, which so far
......
......@@ -24,8 +24,6 @@
*/
typedef struct GlobalTransactionData *GlobalTransaction;
extern GlobalTransaction MyLockedGxact;
/* GUC variable */
extern int max_prepared_xacts;
......@@ -38,17 +36,6 @@ extern void PostPrepare_Twophase(void);
extern PGPROC *TwoPhaseGetDummyProc(TransactionId xid);
extern BackendId TwoPhaseGetDummyBackendId(TransactionId xid);
/*
* IsGXactActive
* Return true if there is a Global transaction entry currently
* locked by us.
*/
static inline bool
IsGXactActive(void)
{
return MyLockedGxact ? true : false;
}
extern GlobalTransaction MarkAsPreparing(TransactionId xid, const char *gid,
TimestampTz prepared_at,
Oid owner, Oid databaseid);
......
......@@ -14,7 +14,6 @@
#ifndef _PROC_H_
#define _PROC_H_
#include "access/clog.h"
#include "access/xlogdefs.h"
#include "lib/ilist.h"
#include "storage/latch.h"
......@@ -162,17 +161,6 @@ struct PGPROC
uint32 wait_event_info; /* proc's wait information */
/* Support for group transaction status update. */
bool clogGroupMember; /* true, if member of clog group */
pg_atomic_uint32 clogGroupNext; /* next clog group member */
TransactionId clogGroupMemberXid; /* transaction id of clog group member */
XidStatus clogGroupMemberXidStatus; /* transaction status of clog
* group member */
int clogGroupMemberPage; /* clog page corresponding to
* transaction id of clog group member */
XLogRecPtr clogGroupMemberLsn; /* WAL location of commit record for
* clog group member */
/* Per-backend LWLock. Protects fields below (but not group fields). */
LWLock backendLock;
......@@ -244,8 +232,6 @@ typedef struct PROC_HDR
PGPROC *bgworkerFreeProcs;
/* First pgproc waiting for group XID clear */
pg_atomic_uint32 procArrayGroupFirst;
/* First pgproc waiting for group transaction status update */
pg_atomic_uint32 clogGroupFirst;
/* WALWriter process's latch */
Latch *walwriterLatch;
/* Checkpointer process's latch */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment