1919 * Portions Copyright (c) 1994, Regents of the University of California
2020 *
2121 * IDENTIFICATION
22- * $PostgreSQL: pgsql/src/backend/utils/time/snapmgr.c,v 1.15 2010/02/26 02:01:15 momjian Exp $
22+ * $PostgreSQL: pgsql/src/backend/utils/time/snapmgr.c,v 1.16 2010/09/11 18:38:56 joe Exp $
2323 *
2424 *-------------------------------------------------------------------------
2525 */
3737
3838
3939/*
40- * CurrentSnapshot points to the only snapshot taken in a serializable
41- * transaction , and to the latest one taken in a read-committed transaction.
40+ * CurrentSnapshot points to the only snapshot taken in transaction-snapshot
41+ * mode , and to the latest one taken in a read-committed transaction.
4242 * SecondarySnapshot is a snapshot that's always up-to-date as of the current
43- * instant, even on a serializable transaction. It should only be used for
43+ * instant, even in transaction-snapshot mode . It should only be used for
4444 * special-purpose code (say, RI checking.)
4545 *
4646 * These SnapshotData structs are static to simplify memory allocation
@@ -97,11 +97,11 @@ static int RegisteredSnapshots = 0;
9797bool FirstSnapshotSet = false;
9898
9999/*
100- * Remembers whether this transaction registered a serializable snapshot at
100+ * Remembers whether this transaction registered a transaction snapshot at
101101 * start. We cannot trust FirstSnapshotSet in combination with
102- * IsXactIsoLevelSerializable , because GUC may be reset before us.
102+ * IsolationUsesXactSnapshot() , because GUC may be reset before us.
103103 */
104- static bool registered_serializable = false;
104+ static bool registered_xact_snapshot = false;
105105
106106
107107static Snapshot CopySnapshot (Snapshot snapshot );
@@ -130,21 +130,21 @@ GetTransactionSnapshot(void)
130130 FirstSnapshotSet = true;
131131
132132 /*
133- * In serializable mode, the first snapshot must live until end of
134- * xact regardless of what the caller does with it, so we must
133+ * In transaction-snapshot mode, the first snapshot must live until
134+ * end of xact regardless of what the caller does with it, so we must
135135 * register it internally here and unregister it at end of xact.
136136 */
137- if (IsXactIsoLevelSerializable )
137+ if (IsolationUsesXactSnapshot () )
138138 {
139139 CurrentSnapshot = RegisterSnapshotOnOwner (CurrentSnapshot ,
140140 TopTransactionResourceOwner );
141- registered_serializable = true;
141+ registered_xact_snapshot = true;
142142 }
143143
144144 return CurrentSnapshot ;
145145 }
146146
147- if (IsXactIsoLevelSerializable )
147+ if (IsolationUsesXactSnapshot () )
148148 return CurrentSnapshot ;
149149
150150 CurrentSnapshot = GetSnapshotData (& CurrentSnapshotData );
@@ -155,7 +155,7 @@ GetTransactionSnapshot(void)
155155/*
156156 * GetLatestSnapshot
157157 * Get a snapshot that is up-to-date as of the current instant,
158- * even if we are executing in SERIALIZABLE mode.
158+ * even if we are executing in transaction-snapshot mode.
159159 */
160160Snapshot
161161GetLatestSnapshot (void )
@@ -515,13 +515,13 @@ void
515515AtEarlyCommit_Snapshot (void )
516516{
517517 /*
518- * On a serializable transaction we must unregister our private refcount
519- * to the serializable snapshot.
518+ * In transaction-snapshot mode we must unregister our private refcount
519+ * to the transaction- snapshot.
520520 */
521- if (registered_serializable )
521+ if (registered_xact_snapshot )
522522 UnregisterSnapshotFromOwner (CurrentSnapshot ,
523523 TopTransactionResourceOwner );
524- registered_serializable = false;
524+ registered_xact_snapshot = false;
525525
526526}
527527
@@ -557,5 +557,5 @@ AtEOXact_Snapshot(bool isCommit)
557557 SecondarySnapshot = NULL ;
558558
559559 FirstSnapshotSet = false;
560- registered_serializable = false;
560+ registered_xact_snapshot = false;
561561}
0 commit comments