mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
Commit 438fc4a39c prevented the WAL replay from writing COMMIT_TS_SETTS record. By this change there is no code that generates COMMIT_TS_SETTS record in PostgreSQL core. Also we can think that there are no extensions using the record because we've not received so far any complaints about the issue that commit 438fc4a39c fixed. Therefore this commit removes COMMIT_TS_SETTS record and its related code. Even without this record, the timestamp required for commit timestamp feature can be acquired from the COMMIT record. Bump WAL page magic. Reported-by: lx zou <zoulx1982@163.com> Author: Fujii Masao Reviewed-by: Alvaro Herrera Discussion: https://postgr.es/m/16931-620d0f2fdc6108f1@postgresql.org
79 lines
2.3 KiB
C
79 lines
2.3 KiB
C
/*
|
|
* commit_ts.h
|
|
*
|
|
* PostgreSQL commit timestamp manager
|
|
*
|
|
* Portions Copyright (c) 1996-2021, 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"
|
|
#include "utils/guc.h"
|
|
|
|
|
|
extern PGDLLIMPORT bool track_commit_timestamp;
|
|
|
|
extern bool check_track_commit_timestamp(bool *newval, void **extra,
|
|
GucSource source);
|
|
|
|
extern void TransactionTreeSetCommitTsData(TransactionId xid, int nsubxids,
|
|
TransactionId *subxids, TimestampTz timestamp,
|
|
RepOriginId nodeid);
|
|
extern bool TransactionIdGetCommitTsData(TransactionId xid,
|
|
TimestampTz *ts, RepOriginId *nodeid);
|
|
extern TransactionId GetLatestCommitTsData(TimestampTz *ts,
|
|
RepOriginId *nodeid);
|
|
|
|
extern Size CommitTsShmemBuffers(void);
|
|
extern Size CommitTsShmemSize(void);
|
|
extern void CommitTsShmemInit(void);
|
|
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_set
|
|
{
|
|
TimestampTz timestamp;
|
|
RepOriginId nodeid;
|
|
TransactionId mainxid;
|
|
/* subxact Xids follow */
|
|
} xl_commit_ts_set;
|
|
|
|
#define SizeOfCommitTsSet (offsetof(xl_commit_ts_set, mainxid) + \
|
|
sizeof(TransactionId))
|
|
|
|
typedef struct xl_commit_ts_truncate
|
|
{
|
|
int 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 */
|