|
4 | 4 | * POSTGRES process array code. |
5 | 5 | * |
6 | 6 | * |
7 | | - * This module maintains an unsorted array of the PGPROC structures for all |
| 7 | + * This module maintains arrays of the PGPROC and PGXACT structures for all |
8 | 8 | * active backends. Although there are several uses for this, the principal |
9 | 9 | * one is as a means of determining the set of currently running transactions. |
10 | 10 | * |
11 | 11 | * Because of various subtle race conditions it is critical that a backend |
12 | | - * hold the correct locks while setting or clearing its MyProc->xid field. |
| 12 | + * hold the correct locks while setting or clearing its MyPgXact->xid field. |
13 | 13 | * See notes in src/backend/access/transam/README. |
14 | 14 | * |
15 | | - * The process array now also includes PGPROC structures representing |
16 | | - * prepared transactions. The xid and subxids fields of these are valid, |
17 | | - * as are the myProcLocks lists. They can be distinguished from regular |
18 | | - * backend PGPROCs at need by checking for pid == 0. |
| 15 | + * The process arrays now also include structures representing prepared |
| 16 | + * transactions. The xid and subxids fields of these are valid, as are the |
| 17 | + * myProcLocks lists. They can be distinguished from regular backend PGPROCs |
| 18 | + * at need by checking for pid == 0. |
19 | 19 | * |
20 | 20 | * During hot standby, we also keep a list of XIDs representing transactions |
21 | 21 | * that are known to be running in the master (or more precisely, were running |
@@ -75,7 +75,7 @@ typedef struct ProcArrayStruct |
75 | 75 | /* |
76 | 76 | * Highest subxid that has been removed from KnownAssignedXids array to |
77 | 77 | * prevent overflow; or InvalidTransactionId if none. We track this for |
78 | | - * similar reasons to tracking overflowing cached subxids in PGPROC |
| 78 | + * similar reasons to tracking overflowing cached subxids in PGXACT |
79 | 79 | * entries. Must hold exclusive ProcArrayLock to change this, and shared |
80 | 80 | * lock to read it. |
81 | 81 | */ |
@@ -440,7 +440,7 @@ ProcArrayEndTransaction(PGPROC *proc, TransactionId latestXid) |
440 | 440 | * This is used after successfully preparing a 2-phase transaction. We are |
441 | 441 | * not actually reporting the transaction's XID as no longer running --- it |
442 | 442 | * will still appear as running because the 2PC's gxact is in the ProcArray |
443 | | - * too. We just have to clear out our own PGPROC. |
| 443 | + * too. We just have to clear out our own PGXACT. |
444 | 444 | */ |
445 | 445 | void |
446 | 446 | ProcArrayClearTransaction(PGPROC *proc) |
@@ -752,24 +752,24 @@ ProcArrayApplyXidAssignment(TransactionId topxid, |
752 | 752 | * there are four possibilities for finding a running transaction: |
753 | 753 | * |
754 | 754 | * 1. The given Xid is a main transaction Id. We will find this out cheaply |
755 | | - * by looking at the PGPROC struct for each backend. |
| 755 | + * by looking at the PGXACT struct for each backend. |
756 | 756 | * |
757 | 757 | * 2. The given Xid is one of the cached subxact Xids in the PGPROC array. |
758 | 758 | * We can find this out cheaply too. |
759 | 759 | * |
760 | 760 | * 3. In Hot Standby mode, we must search the KnownAssignedXids list to see |
761 | 761 | * if the Xid is running on the master. |
762 | 762 | * |
763 | | - * 4. Search the SubTrans tree to find the Xid's topmost parent, and then |
764 | | - * see if that is running according to PGPROC or KnownAssignedXids. This is |
765 | | - * the slowest way, but sadly it has to be done always if the others failed, |
| 763 | + * 4. Search the SubTrans tree to find the Xid's topmost parent, and then see |
| 764 | + * if that is running according to PGXACT or KnownAssignedXids. This is the |
| 765 | + * slowest way, but sadly it has to be done always if the others failed, |
766 | 766 | * unless we see that the cached subxact sets are complete (none have |
767 | 767 | * overflowed). |
768 | 768 | * |
769 | 769 | * ProcArrayLock has to be held while we do 1, 2, 3. If we save the top Xids |
770 | 770 | * while doing 1 and 3, we can release the ProcArrayLock while we do 4. |
771 | 771 | * This buys back some concurrency (and we can't retrieve the main Xids from |
772 | | - * PGPROC again anyway; see GetNewTransactionId). |
| 772 | + * PGXACT again anyway; see GetNewTransactionId). |
773 | 773 | */ |
774 | 774 | bool |
775 | 775 | TransactionIdIsInProgress(TransactionId xid) |
@@ -915,7 +915,7 @@ TransactionIdIsInProgress(TransactionId xid) |
915 | 915 | */ |
916 | 916 | if (RecoveryInProgress()) |
917 | 917 | { |
918 | | - /* none of the PGPROC entries should have XIDs in hot standby mode */ |
| 918 | + /* none of the PGXACT entries should have XIDs in hot standby mode */ |
919 | 919 | Assert(nxids == 0); |
920 | 920 |
|
921 | 921 | if (KnownAssignedXidExists(xid)) |
@@ -1283,7 +1283,7 @@ GetSnapshotData(Snapshot snapshot) |
1283 | 1283 |
|
1284 | 1284 | /* |
1285 | 1285 | * It is sufficient to get shared lock on ProcArrayLock, even if we are |
1286 | | - * going to set MyProc->xmin. |
| 1286 | + * going to set MyPgXact->xmin. |
1287 | 1287 | */ |
1288 | 1288 | LWLockAcquire(ProcArrayLock, LW_SHARED); |
1289 | 1289 |
|
@@ -1462,7 +1462,7 @@ GetSnapshotData(Snapshot snapshot) |
1462 | 1462 | } |
1463 | 1463 |
|
1464 | 1464 | /* |
1465 | | - * ProcArrayInstallImportedXmin -- install imported xmin into MyProc->xmin |
| 1465 | + * ProcArrayInstallImportedXmin -- install imported xmin into MyPgXact->xmin |
1466 | 1466 | * |
1467 | 1467 | * This is called when installing a snapshot imported from another |
1468 | 1468 | * transaction. To ensure that OldestXmin doesn't go backwards, we must |
@@ -1538,7 +1538,7 @@ ProcArrayInstallImportedXmin(TransactionId xmin, TransactionId sourcexid) |
1538 | 1538 | * GetRunningTransactionData -- returns information about running transactions. |
1539 | 1539 | * |
1540 | 1540 | * Similar to GetSnapshotData but returns more information. We include |
1541 | | - * all PGPROCs with an assigned TransactionId, even VACUUM processes. |
| 1541 | + * all PGXACTs with an assigned TransactionId, even VACUUM processes. |
1542 | 1542 | * |
1543 | 1543 | * We acquire XidGenLock, but the caller is responsible for releasing it. |
1544 | 1544 | * This ensures that no new XIDs enter the proc array until the caller has |
@@ -1679,7 +1679,7 @@ GetRunningTransactionData(void) |
1679 | 1679 | * GetOldestActiveTransactionId() |
1680 | 1680 | * |
1681 | 1681 | * Similar to GetSnapshotData but returns just oldestActiveXid. We include |
1682 | | - * all PGPROCs with an assigned TransactionId, even VACUUM processes. |
| 1682 | + * all PGXACTs with an assigned TransactionId, even VACUUM processes. |
1683 | 1683 | * We look at all databases, though there is no need to include WALSender |
1684 | 1684 | * since this has no effect on hot standby conflicts. |
1685 | 1685 | * |
@@ -1744,7 +1744,7 @@ GetOldestActiveTransactionId(void) |
1744 | 1744 | * GetTransactionsInCommit -- Get the XIDs of transactions that are committing |
1745 | 1745 | * |
1746 | 1746 | * Constructs an array of XIDs of transactions that are currently in commit |
1747 | | - * critical sections, as shown by having inCommit set in their PGPROC entries. |
| 1747 | + * critical sections, as shown by having inCommit set in their PGXACT entries. |
1748 | 1748 | * |
1749 | 1749 | * *xids_p is set to a palloc'd array that should be freed by the caller. |
1750 | 1750 | * The return value is the number of valid entries. |
@@ -2189,7 +2189,7 @@ MinimumActiveBackends(int min) |
2189 | 2189 | * |
2190 | 2190 | * If someone just decremented numProcs, 'proc' could also point to a |
2191 | 2191 | * PGPROC entry that's no longer in the array. It still points to a |
2192 | | - * PGPROC struct, though, because freed PGPPROC entries just go to the |
| 2192 | + * PGPROC struct, though, because freed PGPROC entries just go to the |
2193 | 2193 | * free list and are recycled. Its contents are nonsense in that case, |
2194 | 2194 | * but that's acceptable for this function. |
2195 | 2195 | */ |
@@ -2514,7 +2514,7 @@ DisplayXidCache(void) |
2514 | 2514 | * In Hot Standby mode, we maintain a list of transactions that are (or were) |
2515 | 2515 | * running in the master at the current point in WAL. These XIDs must be |
2516 | 2516 | * treated as running by standby transactions, even though they are not in |
2517 | | - * the standby server's PGPROC array. |
| 2517 | + * the standby server's PGXACT array. |
2518 | 2518 | * |
2519 | 2519 | * We record all XIDs that we know have been assigned. That includes all the |
2520 | 2520 | * XIDs seen in WAL records, plus all unobserved XIDs that we can deduce have |
|
0 commit comments