4 * PostgreSQL commit timestamp manager
6 * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * src/include/access/commit_ts.h
14 #include "access/xlog.h"
15 #include "datatype/timestamp.h"
16 #include "replication/origin.h"
17 #include "storage/sync.h"
20 extern PGDLLIMPORT
bool track_commit_timestamp
;
22 extern void TransactionTreeSetCommitTsData(TransactionId xid
, int nsubxids
,
23 TransactionId
*subxids
, TimestampTz timestamp
,
25 extern bool TransactionIdGetCommitTsData(TransactionId xid
,
26 TimestampTz
*ts
, RepOriginId
*nodeid
);
27 extern TransactionId
GetLatestCommitTsData(TimestampTz
*ts
,
30 extern Size
CommitTsShmemBuffers(void);
31 extern Size
CommitTsShmemSize(void);
32 extern void CommitTsShmemInit(void);
33 extern void BootStrapCommitTs(void);
34 extern void StartupCommitTs(void);
35 extern void CommitTsParameterChange(bool newvalue
, bool oldvalue
);
36 extern void CompleteCommitTsInitialization(void);
37 extern void CheckPointCommitTs(void);
38 extern void ExtendCommitTs(TransactionId newestXact
);
39 extern void TruncateCommitTs(TransactionId oldestXact
);
40 extern void SetCommitTsLimit(TransactionId oldestXact
,
41 TransactionId newestXact
);
42 extern void AdvanceOldestCommitTsXid(TransactionId oldestXact
);
44 extern int committssyncfiletag(const FileTag
*ftag
, char *path
);
47 #define COMMIT_TS_ZEROPAGE 0x00
48 #define COMMIT_TS_TRUNCATE 0x10
50 typedef struct xl_commit_ts_set
52 TimestampTz timestamp
;
54 TransactionId mainxid
;
55 /* subxact Xids follow */
58 #define SizeOfCommitTsSet (offsetof(xl_commit_ts_set, mainxid) + \
59 sizeof(TransactionId))
61 typedef struct xl_commit_ts_truncate
64 TransactionId oldestXid
;
65 } xl_commit_ts_truncate
;
67 #define SizeOfCommitTsTruncate (offsetof(xl_commit_ts_truncate, oldestXid) + \
68 sizeof(TransactionId))
70 extern void commit_ts_redo(XLogReaderState
*record
);
71 extern void commit_ts_desc(StringInfo buf
, XLogReaderState
*record
);
72 extern const char *commit_ts_identify(uint8 info
);
74 #endif /* COMMIT_TS_H */