Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
2 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/*
 * commit_ts.h
 *
 * PostgreSQL commit timestamp manager
 *
 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * src/include/access/commit_ts.h
 */
#ifndef COMMIT_TS_H
#define COMMIT_TS_H
 
#include "access/xlog.h"
#include "datatype/timestamp.h"
#include "replication/origin.h"
#include "storage/sync.h"
 
 
extern PGDLLIMPORT bool track_commit_timestamp;
 
extern void TransactionTreeSetCommitTsData(TransactionId xid, int nsubxids,
                                           TransactionId *subxids, TimestampTz timestamp,
                                           ReplOriginId nodeid);
extern bool TransactionIdGetCommitTsData(TransactionId xid,
                                         TimestampTz *ts, ReplOriginId *nodeid);
extern TransactionId GetLatestCommitTsData(TimestampTz *ts,
                                           ReplOriginId *nodeid);
 
extern void BootStrapCommitTs(void);
extern void StartupCommitTs(void);
extern void CommitTsParameterChange(bool newvalue, bool oldvalue);
extern void CompleteCommitTsInitialization(void);
extern void CheckPointCommitTs(void);
extern void ExtendCommitTs(TransactionId newestXact);
extern void TruncateCommitTs(TransactionId oldestXact);
extern void SetCommitTsLimit(TransactionId oldestXact,
                             TransactionId newestXact);
extern void AdvanceOldestCommitTsXid(TransactionId oldestXact);
 
extern int  committssyncfiletag(const FileTag *ftag, char *path);
 
/* XLOG stuff */
#define COMMIT_TS_ZEROPAGE      0x00
#define COMMIT_TS_TRUNCATE      0x10
 
typedef struct xl_commit_ts_truncate
{
    int64       pageno;
    TransactionId oldestXid;
} xl_commit_ts_truncate;
 
#define SizeOfCommitTsTruncate  (offsetof(xl_commit_ts_truncate, oldestXid) + \
                                 sizeof(TransactionId))
 
extern void commit_ts_redo(XLogReaderState *record);
extern void commit_ts_desc(StringInfo buf, XLogReaderState *record);
extern const char *commit_ts_identify(uint8 info);
 
#endif                          /* COMMIT_TS_H */