aboutsummaryrefslogtreecommitdiff
path: root/src/include/access/transam.h
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2017-03-23 14:08:23 -0400
committerRobert Haas <rhaas@postgresql.org>2017-03-23 14:26:31 -0400
commitea42cc18c35381f639d45628d792e790ff39e271 (patch)
tree223916f28189cb8fb5b40793ff563928795f62ca /src/include/access/transam.h
parent50c956add83963d7bbb367dd0b879fccddebd623 (diff)
downloadpostgresql-ea42cc18c35381f639d45628d792e790ff39e271.tar.gz
postgresql-ea42cc18c35381f639d45628d792e790ff39e271.zip
Track the oldest XID that can be safely looked up in CLOG.
This provides infrastructure for looking up arbitrary, user-supplied XIDs without a risk of scary-looking failures from within the clog module. Normally, the oldest XID that can be safely looked up in CLOG is the same as the oldest XID that can reused without causing wraparound, and the latter is already tracked. However, while truncation is in progress, the values are different, so we must keep track of them separately. Craig Ringer, reviewed by Simon Riggs and by me. Discussion: http://postgr.es/m/CAMsr+YHQiWNEi0daCTboS40T+V5s_+dst3PYv_8v2wNVH+Xx4g@mail.gmail.com
Diffstat (limited to 'src/include/access/transam.h')
-rw-r--r--src/include/access/transam.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/include/access/transam.h b/src/include/access/transam.h
index 522c1040737..d25a2dd2073 100644
--- a/src/include/access/transam.h
+++ b/src/include/access/transam.h
@@ -134,6 +134,12 @@ typedef struct VariableCacheData
*/
TransactionId latestCompletedXid; /* newest XID that has committed or
* aborted */
+
+ /*
+ * These fields are protected by CLogTruncationLock
+ */
+ TransactionId oldestClogXid; /* oldest it's safe to look up in clog */
+
} VariableCacheData;
typedef VariableCacheData *VariableCache;
@@ -173,6 +179,7 @@ extern TransactionId GetNewTransactionId(bool isSubXact);
extern TransactionId ReadNewTransactionId(void);
extern void SetTransactionIdLimit(TransactionId oldest_datfrozenxid,
Oid oldest_datoid);
+extern void AdvanceOldestClogXid(TransactionId oldest_datfrozenxid);
extern bool ForceTransactionIdLimitUpdate(void);
extern Oid GetNewObjectId(void);