]> granicus.if.org Git - postgresql/blobdiff - src/backend/utils/time/snapmgr.c
Always SnapshotResetXmin() during ClearTransaction()
[postgresql] / src / backend / utils / time / snapmgr.c
index dff3d51ec3c1c40ba7d21c794fa653a7d56214ad..3d92494e0bad453761aafee4a990854506bd5cdb 100644 (file)
@@ -1051,7 +1051,7 @@ AtSubAbort_Snapshot(int level)
  *             Snapshot manager's cleanup function for end of transaction
  */
 void
-AtEOXact_Snapshot(bool isCommit, bool isPrepare)
+AtEOXact_Snapshot(bool isCommit, bool resetXmin)
 {
        /*
         * In transaction-snapshot mode we must release our privately-managed
@@ -1137,16 +1137,15 @@ AtEOXact_Snapshot(bool isCommit, bool isPrepare)
        FirstSnapshotSet = false;
 
        /*
-        * During normal commit and abort processing, we call
-        * ProcArrayEndTransaction() or ProcArrayClearTransaction() to
-        * reset the PgXact->xmin. That call happens prior to the call to
-        * AtEOXact_Snapshot(), so we need not touch xmin here at all,
-        * accept when we are preparing a transaction.
+        * During normal commit processing, we call
+        * ProcArrayEndTransaction() to reset the PgXact->xmin. That call
+        * happens prior to the call to AtEOXact_Snapshot(), so we need
+        * not touch xmin here at all.
         */
-       if (isPrepare)
+       if (resetXmin)
                SnapshotResetXmin();
 
-       Assert(isPrepare || MyPgXact->xmin == 0);
+       Assert(resetXmin || MyPgXact->xmin == 0);
 }