PostgreSQL Source Code  git master
commit_ts.h
Go to the documentation of this file.
1 /*
2  * commit_ts.h
3  *
4  * PostgreSQL commit timestamp manager
5  *
6  * Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/access/commit_ts.h
10  */
11 #ifndef COMMIT_TS_H
12 #define COMMIT_TS_H
13 
14 #include "access/xlog.h"
15 #include "datatype/timestamp.h"
16 #include "replication/origin.h"
17 #include "storage/sync.h"
18 
19 
21 
22 extern void TransactionTreeSetCommitTsData(TransactionId xid, int nsubxids,
24  RepOriginId nodeid);
26  TimestampTz *ts, RepOriginId *nodeid);
28  RepOriginId *nodeid);
29 
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);
43 
44 extern int committssyncfiletag(const FileTag *ftag, char *path);
45 
46 /* XLOG stuff */
47 #define COMMIT_TS_ZEROPAGE 0x00
48 #define COMMIT_TS_TRUNCATE 0x10
49 
50 typedef struct xl_commit_ts_set
51 {
55  /* subxact Xids follow */
57 
58 #define SizeOfCommitTsSet (offsetof(xl_commit_ts_set, mainxid) + \
59  sizeof(TransactionId))
60 
61 typedef struct xl_commit_ts_truncate
62 {
63  int pageno;
66 
67 #define SizeOfCommitTsTruncate (offsetof(xl_commit_ts_truncate, oldestXid) + \
68  sizeof(TransactionId))
69 
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);
73 
74 #endif /* COMMIT_TS_H */
void CompleteCommitTsInitialization(void)
Definition: commit_ts.c:616
uint32 TransactionId
Definition: c.h:587
int64 timestamp
int64 TimestampTz
Definition: timestamp.h:39
unsigned char uint8
Definition: c.h:439
void commit_ts_desc(StringInfo buf, XLogReaderState *record)
Definition: committsdesc.c:22
uint16 RepOriginId
Definition: xlogdefs.h:65
void BootStrapCommitTs(void)
Definition: commit_ts.c:570
void AdvanceOldestCommitTsXid(TransactionId oldestXact)
Definition: commit_ts.c:904
TimestampTz timestamp
Definition: commit_ts.h:52
#define PGDLLIMPORT
Definition: c.h:1317
void commit_ts_redo(XLogReaderState *record)
Definition: commit_ts.c:984
void CheckPointCommitTs(void)
Definition: commit_ts.c:791
struct xl_commit_ts_set xl_commit_ts_set
static char * buf
Definition: pg_test_fsync.c:68
void CommitTsShmemInit(void)
Definition: commit_ts.c:535
TransactionId oldestXid
Definition: commit_ts.h:64
void CommitTsParameterChange(bool newvalue, bool oldvalue)
Definition: commit_ts.c:638
void ExtendCommitTs(TransactionId newestXact)
Definition: commit_ts.c:813
TransactionId GetLatestCommitTsData(TimestampTz *ts, RepOriginId *nodeid)
Definition: commit_ts.c:352
int committssyncfiletag(const FileTag *ftag, char *path)
Definition: commit_ts.c:1028
void TransactionTreeSetCommitTsData(TransactionId xid, int nsubxids, TransactionId *subxids, TimestampTz timestamp, RepOriginId nodeid)
Definition: commit_ts.c:136
void TruncateCommitTs(TransactionId oldestXact)
Definition: commit_ts.c:851
TransactionId mainxid
Definition: commit_ts.h:54
Size CommitTsShmemSize(void)
Definition: commit_ts.c:524
size_t Size
Definition: c.h:540
struct xl_commit_ts_truncate xl_commit_ts_truncate
PGDLLIMPORT bool track_commit_timestamp
Definition: commit_ts.c:104
RepOriginId nodeid
Definition: commit_ts.h:53
void StartupCommitTs(void)
Definition: commit_ts.c:606
bool TransactionIdGetCommitTsData(TransactionId xid, TimestampTz *ts, RepOriginId *nodeid)
Definition: commit_ts.c:266
Definition: sync.h:50
const char * commit_ts_identify(uint8 info)
Definition: committsdesc.c:44
void SetCommitTsLimit(TransactionId oldestXact, TransactionId newestXact)
Definition: commit_ts.c:877
Size CommitTsShmemBuffers(void)
Definition: commit_ts.c:515