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

Commit4b373e4

Browse files
committed
Improve C comments in GetSnapshotData.
Move discussion of why our algorithm for taking snapshots in recoveryto a more appropriate location in the function, and delete incorrectmention of taking a lock.
1 parent82ef3d3 commit4b373e4

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

‎src/backend/storage/ipc/procarray.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,14 +1307,6 @@ GetSnapshotData(Snapshot snapshot)
13071307
/* initialize xmin calculation with xmax */
13081308
globalxmin=xmin=xmax;
13091309

1310-
/*
1311-
* If we're in recovery then snapshot data comes from a different place,
1312-
* so decide which route we take before grab the lock. It is possible for
1313-
* recovery to end before we finish taking snapshot, and for newly
1314-
* assigned transaction ids to be added to the procarray. Xmax cannot
1315-
* change while we hold ProcArrayLock, so those newly added transaction
1316-
* ids would be filtered away, so we need not be concerned about them.
1317-
*/
13181310
snapshot->takenDuringRecovery=RecoveryInProgress();
13191311

13201312
if (!snapshot->takenDuringRecovery)
@@ -1429,6 +1421,12 @@ GetSnapshotData(Snapshot snapshot)
14291421
* Either way we need to change the way XidInMVCCSnapshot() works
14301422
* depending upon when the snapshot was taken, or change normal
14311423
* snapshot processing so it matches.
1424+
*
1425+
* Note: It is possible for recovery to end before we finish taking the
1426+
* snapshot, and for newly assigned transaction ids to be added to the
1427+
* ProcArray. xmax cannot change while we hold ProcArrayLock, so those
1428+
* newly added transaction ids would be filtered away, so we need not
1429+
* be concerned about them.
14321430
*/
14331431
subcount=KnownAssignedXidsGetAndSetXmin(snapshot->subxip,&xmin,
14341432
xmax);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp