PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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-2017, 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 "utils/guc.h"
18 
19 
21 
22 extern bool check_track_commit_timestamp(bool *newval, void **extra,
23  GucSource source);
24 
25 extern void TransactionTreeSetCommitTsData(TransactionId xid, int nsubxids,
27  RepOriginId nodeid, bool write_xlog);
29  TimestampTz *ts, RepOriginId *nodeid);
31  RepOriginId *nodeid);
32 
33 extern Size CommitTsShmemBuffers(void);
34 extern Size CommitTsShmemSize(void);
35 extern void CommitTsShmemInit(void);
36 extern void BootStrapCommitTs(void);
37 extern void StartupCommitTs(void);
38 extern void CommitTsParameterChange(bool xlrecvalue, bool pgcontrolvalue);
39 extern void CompleteCommitTsInitialization(void);
40 extern void ShutdownCommitTs(void);
41 extern void CheckPointCommitTs(void);
42 extern void ExtendCommitTs(TransactionId newestXact);
43 extern void TruncateCommitTs(TransactionId oldestXact);
44 extern void SetCommitTsLimit(TransactionId oldestXact,
45  TransactionId newestXact);
46 extern void AdvanceOldestCommitTsXid(TransactionId oldestXact);
47 
48 /* XLOG stuff */
49 #define COMMIT_TS_ZEROPAGE 0x00
50 #define COMMIT_TS_TRUNCATE 0x10
51 #define COMMIT_TS_SETTS 0x20
52 
53 typedef struct xl_commit_ts_set
54 {
58  /* subxact Xids follow */
60 
61 #define SizeOfCommitTsSet (offsetof(xl_commit_ts_set, mainxid) + \
62  sizeof(TransactionId))
63 
64 typedef struct xl_commit_ts_truncate
65 {
66  int pageno;
69 
70 #define SizeOfCommitTsTruncate (offsetof(xl_commit_ts_truncate, oldestXid) + \
71  sizeof(TransactionId))
72 
73 extern void commit_ts_redo(XLogReaderState *record);
74 extern void commit_ts_desc(StringInfo buf, XLogReaderState *record);
75 extern const char *commit_ts_identify(uint8 info);
76 
77 #endif /* COMMIT_TS_H */
void CompleteCommitTsInitialization(void)
Definition: commit_ts.c:569
uint32 TransactionId
Definition: c.h:391
int64 timestamp
int64 TimestampTz
Definition: timestamp.h:39
unsigned char uint8
Definition: c.h:256
void commit_ts_desc(StringInfo buf, XLogReaderState *record)
Definition: committsdesc.c:22
void ShutdownCommitTs(void)
Definition: commit_ts.c:745
uint16 RepOriginId
Definition: xlogdefs.h:51
void BootStrapCommitTs(void)
Definition: commit_ts.c:523
struct xl_commit_ts_set xl_commit_ts_set
void AdvanceOldestCommitTsXid(TransactionId oldestXact)
Definition: commit_ts.c:876
TimestampTz timestamp
Definition: commit_ts.h:55
#define PGDLLIMPORT
Definition: c.h:1069
GucSource
Definition: guc.h:105
void CommitTsParameterChange(bool xlrecvalue, bool pgcontrolvalue)
Definition: commit_ts.c:592
void commit_ts_redo(XLogReaderState *record)
Definition: commit_ts.c:963
void CheckPointCommitTs(void)
Definition: commit_ts.c:761
static char * buf
Definition: pg_test_fsync.c:67
void CommitTsShmemInit(void)
Definition: commit_ts.c:490
TransactionId oldestXid
Definition: commit_ts.h:67
void ExtendCommitTs(TransactionId newestXact)
Definition: commit_ts.c:785
TransactionId GetLatestCommitTsData(TimestampTz *ts, RepOriginId *nodeid)
Definition: commit_ts.c:368
void TruncateCommitTs(TransactionId oldestXact)
Definition: commit_ts.c:823
TransactionId mainxid
Definition: commit_ts.h:57
Size CommitTsShmemSize(void)
Definition: commit_ts.c:479
size_t Size
Definition: c.h:350
#define newval
struct xl_commit_ts_truncate xl_commit_ts_truncate
PGDLLIMPORT bool track_commit_timestamp
Definition: commit_ts.c:103
bool check_track_commit_timestamp(bool *newval, void **extra, GucSource source)
RepOriginId nodeid
Definition: commit_ts.h:56
void StartupCommitTs(void)
Definition: commit_ts.c:559
bool TransactionIdGetCommitTsData(TransactionId xid, TimestampTz *ts, RepOriginId *nodeid)
Definition: commit_ts.c:282
const char * commit_ts_identify(uint8 info)
Definition: committsdesc.c:69
void SetCommitTsLimit(TransactionId oldestXact, TransactionId newestXact)
Definition: commit_ts.c:849
Size CommitTsShmemBuffers(void)
Definition: commit_ts.c:470
void TransactionTreeSetCommitTsData(TransactionId xid, int nsubxids, TransactionId *subxids, TimestampTz timestamp, RepOriginId nodeid, bool write_xlog)
Definition: commit_ts.c:145