Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit78d6a9c

Browse files
committed
Fix and improve SnapshotType comments.
The comment for SNAPSHOT_SELF was unfortunately explainingSNAPSHOT_DIRTY, as reported by Sergei. Also expand a few comments, andinclude a few more comments from heapam_visibility.c, so they're in anAM independent place.Reported-By: Sergei KornilovAuthor: Andres FreundDiscussion:https://postgr.es/m/9152241558192351@sas1-d856b3d759c7.qloud-c.yandex.net
1 parentae35e1c commit78d6a9c

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

‎src/include/utils/snapshot.h

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,15 @@ typedef enum SnapshotType
5050
SNAPSHOT_MVCC=0,
5151

5252
/*-------------------------------------------------------------------------
53-
* A tuple is visible iff the tuple is valid including effects of open
54-
* transactions.
53+
* A tuple is visible iff the tuple is valid "for itself".
5554
*
5655
* Here, we consider the effects of:
57-
* - all committedand in-progresstransactions (as of the current instant)
56+
* - all committed transactions (as of the current instant)
5857
* - previous commands of this transaction
5958
* - changes made by the current command
59+
*
60+
* Does _not_ include:
61+
* - in-progress transactions (as of the current instant)
6062
* -------------------------------------------------------------------------
6163
*/
6264
SNAPSHOT_SELF,
@@ -79,6 +81,22 @@ typedef enum SnapshotType
7981
* - all committed and in-progress transactions (as of the current instant)
8082
* - previous commands of this transaction
8183
* - changes made by the current command
84+
*
85+
* This is essentially like SNAPSHOT_SELF as far as effects of the current
86+
* transaction and committed/aborted xacts are concerned. However, it
87+
* also includes the effects of other xacts still in progress.
88+
*
89+
* A special hack is that when a snapshot of this type is used to
90+
* determine tuple visibility, the passed-in snapshot struct is used as an
91+
* output argument to return the xids of concurrent xacts that affected
92+
* the tuple. snapshot->xmin is set to the tuple's xmin if that is
93+
* another transaction that's still in progress; or to
94+
* InvalidTransactionId if the tuple's xmin is committed good, committed
95+
* dead, or my own xact. Similarly for snapshot->xmax and the tuple's
96+
* xmax. If the tuple was inserted speculatively, meaning that the
97+
* inserter might still back down on the insertion without aborting the
98+
* whole transaction, the associated token is also returned in
99+
* snapshot->speculativeToken. See also InitDirtySnapshot().
82100
* -------------------------------------------------------------------------
83101
*/
84102
SNAPSHOT_DIRTY,
@@ -92,9 +110,10 @@ typedef enum SnapshotType
92110

93111
/*
94112
* A tuple is visible iff the tuple might be visible to some transaction;
95-
* false if it's surely dead to everyone,ie, vacuumable.
113+
* false if it's surely dead to everyone,i.e., vacuumable.
96114
*
97-
* Snapshot.xmin must have been set up with the xmin horizon to use.
115+
* For visibility checks snapshot->min must have been set up with the xmin
116+
* horizon to use.
98117
*/
99118
SNAPSHOT_NON_VACUUMABLE
100119
}SnapshotType;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp