Skip to content

Commit 3428ef7

Browse files
Reverting 42b4b0b
Buildfarm issues and other reported issues
1 parent 70adf2f commit 3428ef7

File tree

3 files changed

+7
-22
lines changed

3 files changed

+7
-22
lines changed

src/backend/access/transam/xact.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,7 @@ CommitTransaction(void)
21372137
AtEOXact_ComboCid();
21382138
AtEOXact_HashTables(true);
21392139
AtEOXact_PgStat(true);
2140-
AtEOXact_Snapshot(true, false);
2140+
AtEOXact_Snapshot(true);
21412141
AtCommit_ApplyLauncher();
21422142
pgstat_report_xact_timestamp(0);
21432143

@@ -2409,7 +2409,7 @@ PrepareTransaction(void)
24092409
AtEOXact_ComboCid();
24102410
AtEOXact_HashTables(true);
24112411
/* don't call AtEOXact_PgStat here; we fixed pgstat state above */
2412-
AtEOXact_Snapshot(true, true);
2412+
AtEOXact_Snapshot(true);
24132413
pgstat_report_xact_timestamp(0);
24142414

24152415
CurrentResourceOwner = NULL;
@@ -2640,7 +2640,7 @@ CleanupTransaction(void)
26402640
* do abort cleanup processing
26412641
*/
26422642
AtCleanup_Portals(); /* now safe to release portal memory */
2643-
AtEOXact_Snapshot(false, false); /* and release the transaction's snapshots */
2643+
AtEOXact_Snapshot(false); /* and release the transaction's snapshots */
26442644

26452645
CurrentResourceOwner = NULL; /* and resource owner */
26462646
if (TopTransactionResourceOwner)

src/backend/utils/time/snapmgr.c

+3-18
Original file line numberDiff line numberDiff line change
@@ -954,12 +954,7 @@ xmin_cmp(const pairingheap_node *a, const pairingheap_node *b, void *arg)
954954
*
955955
* If there are no more snapshots, we can reset our PGXACT->xmin to InvalidXid.
956956
* Note we can do this without locking because we assume that storing an Xid
957-
* is atomic. We do this because it will allow multi-statement transactions to
958-
* reset their xmin and prevent us from holding back removal of dead rows;
959-
* this has little purpose when we are dealing with very fast statements in
960-
* read committed mode since the xmin will advance quickly anyway. It has no
961-
* use at all when we are running single statement transactions since the xmin
962-
* is reset as part of end of transaction anyway.
957+
* is atomic.
963958
*
964959
* Even if there are some remaining snapshots, we may be able to advance our
965960
* PGXACT->xmin to some degree. This typically happens when a portal is
@@ -1056,7 +1051,7 @@ AtSubAbort_Snapshot(int level)
10561051
* Snapshot manager's cleanup function for end of transaction
10571052
*/
10581053
void
1059-
AtEOXact_Snapshot(bool isCommit, bool isPrepare)
1054+
AtEOXact_Snapshot(bool isCommit)
10601055
{
10611056
/*
10621057
* In transaction-snapshot mode we must release our privately-managed
@@ -1141,17 +1136,7 @@ AtEOXact_Snapshot(bool isCommit, bool isPrepare)
11411136

11421137
FirstSnapshotSet = false;
11431138

1144-
/*
1145-
* During normal commit and abort processing, we call
1146-
* ProcArrayEndTransaction() or ProcArrayClearTransaction() to
1147-
* reset the PgXact->xmin. That call happens prior to the call to
1148-
* AtEOXact_Snapshot(), so we need not touch xmin here at all,
1149-
* accept when we are preparing a transaction.
1150-
*/
1151-
if (isPrepare)
1152-
SnapshotResetXmin();
1153-
1154-
Assert(MyPgXact->xmin == 0);
1139+
SnapshotResetXmin();
11551140
}
11561141

11571142

src/include/utils/snapmgr.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ extern void UnregisterSnapshotFromOwner(Snapshot snapshot, ResourceOwner owner);
8585

8686
extern void AtSubCommit_Snapshot(int level);
8787
extern void AtSubAbort_Snapshot(int level);
88-
extern void AtEOXact_Snapshot(bool isCommit, bool isPrepare);
88+
extern void AtEOXact_Snapshot(bool isCommit);
8989

9090
extern void ImportSnapshot(const char *idstr);
9191
extern bool XactHasExportedSnapshots(void);

0 commit comments

Comments
 (0)