Skip to content

Commit 5af4303

Browse files
committed
Undo changes in tqual
1 parent 4f5849d commit 5af4303

File tree

4 files changed

+3
-41
lines changed

4 files changed

+3
-41
lines changed

contrib/pg_xtm/pg_dtm.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,14 +108,6 @@ static XidStatus DtmGetTransactionStatus(TransactionId xid, XLogRecPtr *lsn)
108108
return status;
109109
}
110110

111-
static bool TransactionIsInDtmSnapshot(TransactionId xid)
112-
{
113-
return bsearch(&xid, DtmSnapshot.xip, DtmSnapshot.xcnt,
114-
sizeof(TransactionId), xidComparator) != NULL;
115-
}
116-
117-
118-
119111
static void DtmSetTransactionStatus(TransactionId xid, int nsubxids, TransactionId *subxids, XidStatus status, XLogRecPtr lsn)
120112
{
121113
if (DtmHasSnapshot) {
@@ -139,8 +131,6 @@ static void DtmSetTransactionStatus(TransactionId xid, int nsubxids, Transaction
139131
* ***************************************************************************
140132
*/
141133

142-
extern bool (*TransactionIsInCurrentSnapshot)(TransactionId xid);
143-
144134
void
145135
_PG_init(void)
146136
{

src/backend/access/transam/twophase.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -699,9 +699,7 @@ RemoveGXid(TransactionId xid)
699699
TwoPhaseState->prepXacts[i]->next = TwoPhaseState->freeGXacts;
700700
TwoPhaseState->freeGXacts = TwoPhaseState->prepXacts[i];
701701

702-
LWLockRelease(TwoPhaseStateLock);
703-
704-
return;
702+
break;
705703
}
706704
}
707705

src/backend/storage/ipc/procarray.c

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@
6262
#include "utils/tqual.h"
6363
#include "utils/snapmgr.h"
6464

65-
static bool
66-
TransactionIdIsRunning(TransactionId xid);
67-
6865
/* Our shared memory area */
6966
typedef struct ProcArrayStruct
7067
{
@@ -948,14 +945,6 @@ ProcArrayApplyXidAssignment(TransactionId topxid,
948945
LWLockRelease(ProcArrayLock);
949946
}
950947

951-
bool (*TransactionIsInCurrentSnapshot)(TransactionId xid);
952-
953-
bool
954-
TransactionIdIsInProgress(TransactionId xid)
955-
{
956-
return TransactionIdIsRunning(xid) || (TransactionIsInCurrentSnapshot && TransactionIsInCurrentSnapshot(xid));
957-
}
958-
959948
/*
960949
* TransactionIdIsInProgress -- is given transaction running in some backend
961950
*
@@ -983,7 +972,7 @@ TransactionIdIsInProgress(TransactionId xid)
983972
* PGXACT again anyway; see GetNewTransactionId).
984973
*/
985974
bool
986-
TransactionIdIsRunning(TransactionId xid)
975+
TransactionIdIsInProgress(TransactionId xid)
987976
{
988977
static TransactionId *xids = NULL;
989978
int nxids = 0;
@@ -3914,5 +3903,5 @@ void VacuumProcArray(Snapshot snapshot)
39143903
arrayP->numProcs--;
39153904
}
39163905
LWLockRelease(ProcArrayLock);
3917-
elog(WARNING, "VacuumProcArray: %d in progress, %d completed, %d total\n", nInProgress, nCompleted, arrayP->numProcs);
3906+
//elog(WARNING, "VacuumProcArray: %d in progress, %d completed, %d total\n", nInProgress, nCompleted, arrayP->numProcs);
39183907
}

src/backend/utils/time/tqual.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -318,10 +318,8 @@ HeapTupleSatisfiesSelf(HeapTuple htup, Snapshot snapshot, Buffer buffer)
318318
if (!TransactionIdDidCommit(HeapTupleHeaderGetRawXmax(tuple)))
319319
{
320320
/* it must have aborted or crashed */
321-
#if 1
322321
SetHintBits(tuple, buffer, HEAP_XMAX_INVALID,
323322
InvalidTransactionId);
324-
#endif
325323
return true;
326324
}
327325

@@ -697,10 +695,8 @@ HeapTupleSatisfiesUpdate(HeapTuple htup, CommandId curcid,
697695
if (!TransactionIdDidCommit(HeapTupleHeaderGetRawXmax(tuple)))
698696
{
699697
/* it must have aborted or crashed */
700-
#if 1
701698
SetHintBits(tuple, buffer, HEAP_XMAX_INVALID,
702699
InvalidTransactionId);
703-
#endif
704700
return HeapTupleMayBeUpdated;
705701
}
706702

@@ -848,7 +844,6 @@ HeapTupleSatisfiesDirty(HeapTuple htup, Snapshot snapshot,
848844
}
849845

850846
snapshot->xmin = HeapTupleHeaderGetRawXmin(tuple);
851-
snapshot->xmax = HeapTupleHeaderGetRawXmax(tuple);
852847
/* XXX shouldn't we fall through to look at xmax? */
853848
return true; /* in insertion by other */
854849
}
@@ -920,10 +915,8 @@ HeapTupleSatisfiesDirty(HeapTuple htup, Snapshot snapshot,
920915
if (!TransactionIdDidCommit(HeapTupleHeaderGetRawXmax(tuple)))
921916
{
922917
/* it must have aborted or crashed */
923-
#if 1
924918
SetHintBits(tuple, buffer, HEAP_XMAX_INVALID,
925919
InvalidTransactionId);
926-
#endif
927920
return true;
928921
}
929922

@@ -1132,10 +1125,8 @@ HeapTupleSatisfiesMVCC(HeapTuple htup, Snapshot snapshot,
11321125
if (!TransactionIdDidCommit(HeapTupleHeaderGetRawXmax(tuple)))
11331126
{
11341127
/* it must have aborted or crashed */
1135-
#if 1
11361128
SetHintBits(tuple, buffer, HEAP_XMAX_INVALID,
11371129
InvalidTransactionId);
1138-
#endif
11391130
return true;
11401131
}
11411132

@@ -1305,10 +1296,8 @@ HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
13051296
{
13061297
if (TransactionIdIsInProgress(HeapTupleHeaderGetRawXmax(tuple)))
13071298
return HEAPTUPLE_LIVE;
1308-
#if 1
13091299
SetHintBits(tuple, buffer, HEAP_XMAX_INVALID,
13101300
InvalidTransactionId);
1311-
#endif
13121301
}
13131302
}
13141303

@@ -1365,9 +1354,7 @@ HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
13651354
* Not in Progress, Not Committed, so either Aborted or crashed.
13661355
* Remove the Xmax.
13671356
*/
1368-
#if 1
13691357
SetHintBits(tuple, buffer, HEAP_XMAX_INVALID, InvalidTransactionId);
1370-
#endif
13711358
return HEAPTUPLE_LIVE;
13721359
}
13731360

@@ -1383,10 +1370,8 @@ HeapTupleSatisfiesVacuum(HeapTuple htup, TransactionId OldestXmin,
13831370
/*
13841371
* Not in Progress, Not Committed, so either Aborted or crashed
13851372
*/
1386-
#if 1
13871373
SetHintBits(tuple, buffer, HEAP_XMAX_INVALID,
13881374
InvalidTransactionId);
1389-
#endif
13901375
return HEAPTUPLE_LIVE;
13911376
}
13921377

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy