mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-21 22:07:01 +08:00
Cleanup initialization of Hot Standby. Clarify working with reanalysis
of requirements and documentation on LogStandbySnapshot(). Fixes two minor bugs reported by Tom Lane that would lead to an incorrect snapshot after transaction wraparound. Also fix two other problems discovered that would give incorrect snapshots in certain cases. ProcArrayApplyRecoveryInfo() substantially rewritten. Some minor refactoring of xact_redo_apply() and ExpireTreeKnownAssignedTransactionIds().
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/storage/procarray.h,v 1.31 2010/01/23 16:37:12 sriggs Exp $
|
||||
* $PostgreSQL: pgsql/src/include/storage/procarray.h,v 1.32 2010/05/13 11:15:38 sriggs Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -35,7 +35,8 @@ extern void ProcArrayApplyXidAssignment(TransactionId topxid,
|
||||
|
||||
extern void RecordKnownAssignedTransactionIds(TransactionId xid);
|
||||
extern void ExpireTreeKnownAssignedTransactionIds(TransactionId xid,
|
||||
int nsubxids, TransactionId *subxids);
|
||||
int nsubxids, TransactionId *subxids,
|
||||
TransactionId max_xid);
|
||||
extern void ExpireAllKnownAssignedTransactionIds(void);
|
||||
extern void ExpireOldKnownAssignedTransactionIds(TransactionId xid);
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/storage/standby.h,v 1.9 2010/02/26 02:01:28 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/include/storage/standby.h,v 1.10 2010/05/13 11:15:38 sriggs Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -68,6 +68,7 @@ typedef struct xl_running_xacts
|
||||
bool subxid_overflow; /* snapshot overflowed, subxids missing */
|
||||
TransactionId nextXid; /* copy of ShmemVariableCache->nextXid */
|
||||
TransactionId oldestRunningXid; /* *not* oldestXmin */
|
||||
TransactionId latestCompletedXid; /* so we can set xmax */
|
||||
|
||||
TransactionId xids[1]; /* VARIABLE LENGTH ARRAY */
|
||||
} xl_running_xacts;
|
||||
@ -97,6 +98,7 @@ typedef struct RunningTransactionsData
|
||||
bool subxid_overflow; /* snapshot overflowed, subxids missing */
|
||||
TransactionId nextXid; /* copy of ShmemVariableCache->nextXid */
|
||||
TransactionId oldestRunningXid; /* *not* oldestXmin */
|
||||
TransactionId latestCompletedXid; /* so we can set xmax */
|
||||
|
||||
TransactionId *xids; /* array of (sub)xids still running */
|
||||
} RunningTransactionsData;
|
||||
|
||||
Reference in New Issue
Block a user