PostgreSQL Source Code  git master
xlog.h
Go to the documentation of this file.
1 /*
2  * xlog.h
3  *
4  * PostgreSQL write-ahead log manager
5  *
6  * Portions Copyright (c) 1996-2022, PostgreSQL Global Development Group
7  * Portions Copyright (c) 1994, Regents of the University of California
8  *
9  * src/include/access/xlog.h
10  */
11 #ifndef XLOG_H
12 #define XLOG_H
13 
14 #include "access/rmgr.h"
15 #include "access/xlogdefs.h"
16 #include "access/xloginsert.h"
17 #include "access/xlogreader.h"
18 #include "datatype/timestamp.h"
19 #include "lib/stringinfo.h"
20 #include "nodes/pg_list.h"
21 #include "storage/fd.h"
22 
23 
24 /* Sync methods */
25 #define SYNC_METHOD_FSYNC 0
26 #define SYNC_METHOD_FDATASYNC 1
27 #define SYNC_METHOD_OPEN 2 /* for O_SYNC */
28 #define SYNC_METHOD_FSYNC_WRITETHROUGH 3
29 #define SYNC_METHOD_OPEN_DSYNC 4 /* for O_DSYNC */
30 extern int sync_method;
31 
32 /*
33  * Recovery target type.
34  * Only set during a Point in Time recovery, not when in standby mode.
35  */
36 typedef enum
37 {
45 
46 /*
47  * Recovery target TimeLine goal
48  */
49 typedef enum
50 {
55 
59 
60 extern bool reachedConsistency;
61 
62 /* these variables are GUC parameters related to XLOG */
63 extern int wal_segment_size;
64 extern int min_wal_size_mb;
65 extern int max_wal_size_mb;
66 extern int wal_keep_size_mb;
67 extern int max_slot_wal_keep_size_mb;
68 extern int XLOGbuffers;
69 extern int XLogArchiveTimeout;
71 extern char *XLogArchiveCommand;
72 extern bool EnableHotStandby;
73 extern bool fullPageWrites;
74 extern bool wal_log_hints;
75 extern int wal_compression;
76 extern bool wal_init_zero;
77 extern bool wal_recycle;
78 extern bool *wal_consistency_checking;
80 extern bool log_checkpoints;
81 extern char *recoveryRestoreCommand;
82 extern char *recoveryEndCommand;
83 extern char *archiveCleanupCommand;
84 extern bool recoveryTargetInclusive;
85 extern int recoveryTargetAction;
86 extern int recovery_min_apply_delay;
87 extern char *PrimaryConnInfo;
88 extern char *PrimarySlotName;
90 extern bool track_wal_io_timing;
91 
92 /* indirectly set via GUC system */
94 extern char *recovery_target_time_string;
95 extern const char *recoveryTargetName;
98 extern char *PromoteTriggerFile;
102 
103 extern int CheckPointSegments;
104 
105 /* option set locally in startup process only when signal files exist */
106 extern bool StandbyModeRequested;
107 extern bool StandbyMode;
108 
109 /* Archive modes */
110 typedef enum ArchiveMode
111 {
112  ARCHIVE_MODE_OFF = 0, /* disabled */
113  ARCHIVE_MODE_ON, /* enabled while server is running normally */
114  ARCHIVE_MODE_ALWAYS /* enabled always (even during recovery) */
116 extern int XLogArchiveMode;
117 
118 /* WAL levels */
119 typedef enum WalLevel
120 {
125 
126 /* Compression algorithms for WAL */
127 typedef enum WalCompression
128 {
133 
134 /* Recovery states */
135 typedef enum RecoveryState
136 {
137  RECOVERY_STATE_CRASH = 0, /* crash recovery */
138  RECOVERY_STATE_ARCHIVE, /* archive recovery */
139  RECOVERY_STATE_DONE /* currently in production */
141 
142 /* Recovery pause states */
143 typedef enum RecoveryPauseState
144 {
145  RECOVERY_NOT_PAUSED, /* pause not requested */
146  RECOVERY_PAUSE_REQUESTED, /* pause requested, but not yet paused */
147  RECOVERY_PAUSED /* recovery is paused */
149 
150 extern PGDLLIMPORT int wal_level;
151 
152 /* Is WAL archiving enabled (always or only while server is running normally)? */
153 #define XLogArchivingActive() \
154  (AssertMacro(XLogArchiveMode == ARCHIVE_MODE_OFF || wal_level >= WAL_LEVEL_REPLICA), XLogArchiveMode > ARCHIVE_MODE_OFF)
155 /* Is WAL archiving enabled always (even during recovery)? */
156 #define XLogArchivingAlways() \
157  (AssertMacro(XLogArchiveMode == ARCHIVE_MODE_OFF || wal_level >= WAL_LEVEL_REPLICA), XLogArchiveMode == ARCHIVE_MODE_ALWAYS)
158 #define XLogArchiveCommandSet() (XLogArchiveCommand[0] != '\0')
159 
160 /*
161  * Is WAL-logging necessary for archival or log-shipping, or can we skip
162  * WAL-logging if we fsync() the data before committing instead?
163  */
164 #define XLogIsNeeded() (wal_level >= WAL_LEVEL_REPLICA)
165 
166 /*
167  * Is a full-page image needed for hint bit updates?
168  *
169  * Normally, we don't WAL-log hint bit updates, but if checksums are enabled,
170  * we have to protect them against torn page writes. When you only set
171  * individual bits on a page, it's still consistent no matter what combination
172  * of the bits make it to disk, but the checksum wouldn't match. Also WAL-log
173  * them if forced by wal_log_hints=on.
174  */
175 #define XLogHintBitIsNeeded() (DataChecksumsEnabled() || wal_log_hints)
176 
177 /* Do we need to WAL-log information required only for Hot Standby and logical replication? */
178 #define XLogStandbyInfoActive() (wal_level >= WAL_LEVEL_REPLICA)
179 
180 /* Do we need to WAL-log information required only for logical replication? */
181 #define XLogLogicalInfoActive() (wal_level >= WAL_LEVEL_LOGICAL)
182 
183 #ifdef WAL_DEBUG
184 extern bool XLOG_DEBUG;
185 #endif
186 
187 /*
188  * OR-able request flag bits for checkpoints. The "cause" bits are used only
189  * for logging purposes. Note: the flags must be defined so that it's
190  * sensible to OR together request flags arising from different requestors.
191  */
192 
193 /* These directly affect the behavior of CreateCheckPoint and subsidiaries */
194 #define CHECKPOINT_IS_SHUTDOWN 0x0001 /* Checkpoint is for shutdown */
195 #define CHECKPOINT_END_OF_RECOVERY 0x0002 /* Like shutdown checkpoint, but
196  * issued at end of WAL recovery */
197 #define CHECKPOINT_IMMEDIATE 0x0004 /* Do it without delays */
198 #define CHECKPOINT_FORCE 0x0008 /* Force even if no activity */
199 #define CHECKPOINT_FLUSH_ALL 0x0010 /* Flush all pages, including those
200  * belonging to unlogged tables */
201 /* These are important to RequestCheckpoint */
202 #define CHECKPOINT_WAIT 0x0020 /* Wait for completion */
203 #define CHECKPOINT_REQUESTED 0x0040 /* Checkpoint request has been made */
204 /* These indicate the cause of a checkpoint request */
205 #define CHECKPOINT_CAUSE_XLOG 0x0080 /* XLOG consumption */
206 #define CHECKPOINT_CAUSE_TIME 0x0100 /* Elapsed time */
207 
208 /*
209  * Flag bits for the record being inserted, set using XLogSetRecordFlags().
210  */
211 #define XLOG_INCLUDE_ORIGIN 0x01 /* include the replication origin */
212 #define XLOG_MARK_UNIMPORTANT 0x02 /* record not important for durability */
213 
214 
215 /* Checkpoint statistics */
216 typedef struct CheckpointStatsData
217 {
218  TimestampTz ckpt_start_t; /* start of checkpoint */
219  TimestampTz ckpt_write_t; /* start of flushing buffers */
220  TimestampTz ckpt_sync_t; /* start of fsyncs */
221  TimestampTz ckpt_sync_end_t; /* end of fsyncs */
222  TimestampTz ckpt_end_t; /* end of checkpoint */
223 
224  int ckpt_bufs_written; /* # of buffers written */
225 
226  int ckpt_segs_added; /* # of new xlog segments created */
227  int ckpt_segs_removed; /* # of xlog segments deleted */
228  int ckpt_segs_recycled; /* # of xlog segments recycled */
229 
230  int ckpt_sync_rels; /* # of relations synced */
231  uint64 ckpt_longest_sync; /* Longest sync for one relation */
232  uint64 ckpt_agg_sync_time; /* The sum of all the individual sync
233  * times, which is not necessarily the
234  * same as the total elapsed time for the
235  * entire sync phase. */
237 
239 
240 /*
241  * GetWALAvailability return codes
242  */
243 typedef enum WALAvailability
244 {
245  WALAVAIL_INVALID_LSN, /* parameter error */
246  WALAVAIL_RESERVED, /* WAL segment is within max_wal_size */
247  WALAVAIL_EXTENDED, /* WAL segment is reserved by a slot or
248  * wal_keep_size */
249  WALAVAIL_UNRESERVED, /* no longer reserved, but not removed yet */
250  WALAVAIL_REMOVED /* WAL segment has been removed */
252 
253 struct XLogRecData;
254 
255 extern XLogRecPtr XLogInsertRecord(struct XLogRecData *rdata,
256  XLogRecPtr fpw_lsn,
257  uint8 flags,
258  int num_fpi,
259  bool topxid_included);
260 extern void XLogFlush(XLogRecPtr RecPtr);
261 extern bool XLogBackgroundFlush(void);
262 extern bool XLogNeedsFlush(XLogRecPtr RecPtr);
263 extern int XLogFileInit(XLogSegNo segno, TimeLineID tli);
264 extern int XLogFileOpen(XLogSegNo segno, TimeLineID tli);
265 
266 extern void CheckXLogRemoved(XLogSegNo segno, TimeLineID tli);
268 extern void XLogSetAsyncXactLSN(XLogRecPtr record);
270 
271 extern void xlog_redo(XLogReaderState *record);
272 extern void xlog_desc(StringInfo buf, XLogReaderState *record);
273 extern const char *xlog_identify(uint8 info);
274 
275 extern void issue_xlog_fsync(int fd, XLogSegNo segno, TimeLineID tli);
276 
277 extern bool RecoveryInProgress(void);
278 extern RecoveryState GetRecoveryState(void);
279 extern bool HotStandbyActive(void);
280 extern bool HotStandbyActiveInReplay(void);
281 extern bool XLogInsertAllowed(void);
282 extern void GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream);
283 extern XLogRecPtr GetXLogReplayRecPtr(TimeLineID *replayTLI);
284 extern XLogRecPtr GetXLogInsertRecPtr(void);
285 extern XLogRecPtr GetXLogWriteRecPtr(void);
287 extern void SetRecoveryPause(bool recoveryPause);
288 extern TimestampTz GetLatestXTime(void);
290 
291 extern void UpdateControlFile(void);
292 extern uint64 GetSystemIdentifier(void);
293 extern char *GetMockAuthenticationNonce(void);
294 extern bool DataChecksumsEnabled(void);
296 extern Size XLOGShmemSize(void);
297 extern void XLOGShmemInit(void);
298 extern void BootStrapXLOG(void);
299 extern void LocalProcessControlFile(bool reset);
300 extern void StartupXLOG(void);
301 extern void ShutdownXLOG(int code, Datum arg);
302 extern void CreateCheckPoint(int flags);
303 extern bool CreateRestartPoint(int flags);
306 extern void XLogPutNextOid(Oid nextOid);
307 extern XLogRecPtr XLogRestorePoint(const char *rpName);
308 extern void UpdateFullPageWrites(void);
309 extern void GetFullPageWriteInfo(XLogRecPtr *RedoRecPtr_p, bool *doPageWrites_p);
310 extern XLogRecPtr GetRedoRecPtr(void);
311 extern XLogRecPtr GetInsertRecPtr(void);
312 extern XLogRecPtr GetFlushRecPtr(TimeLineID *insertTLI);
315 extern void RemovePromoteSignalFiles(void);
316 
317 extern bool PromoteIsTriggered(void);
318 extern bool CheckPromoteSignal(void);
319 extern void WakeupRecovery(void);
320 extern void SetWalWriterSleeping(bool sleeping);
321 
322 extern void StartupRequestWalReceiverRestart(void);
323 extern void XLogRequestWalReceiverReply(void);
324 
325 extern void assign_max_wal_size(int newval, void *extra);
326 extern void assign_checkpoint_completion_target(double newval, void *extra);
327 
328 /*
329  * Routines to start, stop, and get status of a base backup.
330  */
331 
332 /*
333  * Session-level status of base backups
334  *
335  * This is used in parallel with the shared memory status to control parallel
336  * execution of base backup functions for a given session, be it a backend
337  * dedicated to replication or a normal backend connected to a database. The
338  * update of the session-level status happens at the same time as the shared
339  * memory counters to keep a consistent global and local state of the backups
340  * running.
341  */
342 typedef enum SessionBackupState
343 {
348 
349 extern XLogRecPtr do_pg_start_backup(const char *backupidstr, bool fast,
350  TimeLineID *starttli_p, StringInfo labelfile,
351  List **tablespaces, StringInfo tblspcmapfile);
352 extern XLogRecPtr do_pg_stop_backup(char *labelfile, bool waitforarchive,
353  TimeLineID *stoptli_p);
354 extern void do_pg_abort_backup(int code, Datum arg);
357 
358 /* File path names (all relative to $PGDATA) */
359 #define RECOVERY_SIGNAL_FILE "recovery.signal"
360 #define STANDBY_SIGNAL_FILE "standby.signal"
361 #define BACKUP_LABEL_FILE "backup_label"
362 #define BACKUP_LABEL_OLD "backup_label.old"
363 
364 #define TABLESPACE_MAP "tablespace_map"
365 #define TABLESPACE_MAP_OLD "tablespace_map.old"
366 
367 /* files to signal promotion to primary */
368 #define PROMOTE_SIGNAL_FILE "promote"
369 
370 #endif /* XLOG_H */
#define PGDLLIMPORT
Definition: c.h:1331
unsigned char uint8
Definition: c.h:439
uint32 TransactionId
Definition: c.h:587
size_t Size
Definition: c.h:540
int64 TimestampTz
Definition: timestamp.h:39
#define newval
void * arg
static char * buf
Definition: pg_test_fsync.c:70
uintptr_t Datum
Definition: postgres.h:411
unsigned int Oid
Definition: postgres_ext.h:31
static int fd(const char *x, int i)
Definition: preproc-init.c:105
void reset(void)
Definition: sql-declare.c:600
uint64 ckpt_agg_sync_time
Definition: xlog.h:230
uint64 ckpt_longest_sync
Definition: xlog.h:229
TimestampTz ckpt_start_t
Definition: xlog.h:216
TimestampTz ckpt_end_t
Definition: xlog.h:220
int ckpt_segs_removed
Definition: xlog.h:225
TimestampTz ckpt_write_t
Definition: xlog.h:217
int ckpt_segs_added
Definition: xlog.h:224
TimestampTz ckpt_sync_end_t
Definition: xlog.h:219
TimestampTz ckpt_sync_t
Definition: xlog.h:218
int ckpt_bufs_written
Definition: xlog.h:222
int ckpt_segs_recycled
Definition: xlog.h:226
int ckpt_sync_rels
Definition: xlog.h:228
Definition: pg_list.h:51
bool reachedConsistency
Definition: xlog.c:881
uint64 GetSystemIdentifier(void)
Definition: xlog.c:5061
XLogRecPtr ProcLastRecPtr
Definition: xlog.c:342
bool fullPageWrites
Definition: xlog.c:103
void UpdateFullPageWrites(void)
Definition: xlog.c:10189
bool RecoveryInProgress(void)
Definition: xlog.c:8403
void GetFullPageWriteInfo(XLogRecPtr *RedoRecPtr_p, bool *doPageWrites_p)
Definition: xlog.c:8680
TimeLineID GetWALInsertionTimeLine(void)
Definition: xlog.c:8735
int recovery_min_apply_delay
Definition: xlog.c:279
bool HotStandbyActive(void)
Definition: xlog.c:8460
void do_pg_abort_backup(int code, Datum arg)
Definition: xlog.c:11917
XLogSegNo XLogGetLastRemovedSegno(void)
Definition: xlog.c:4085
XLogRecPtr CalculateMaxmumSafeLSN(void)
void xlog_desc(StringInfo buf, XLogReaderState *record)
Definition: xlogdesc.c:37
char * XLogArchiveCommand
Definition: xlog.c:101
RecoveryTargetTimeLineGoal recoveryTargetTimeLineGoal
Definition: xlog.c:321
int wal_keep_size_mb
Definition: xlog.c:97
int recoveryTargetAction
Definition: xlog.c:273
bool EnableHotStandby
Definition: xlog.c:102
XLogRecPtr GetRedoRecPtr(void)
Definition: xlog.c:8650
const char * recoveryTargetName
Definition: xlog.c:277
bool XLogNeedsFlush(XLogRecPtr RecPtr)
Definition: xlog.c:3252
void XLogFlush(XLogRecPtr RecPtr)
Definition: xlog.c:2923
XLogRecPtr XLogInsertRecord(struct XLogRecData *rdata, XLogRecPtr fpw_lsn, uint8 flags, int num_fpi, bool topxid_included)
Definition: xlog.c:1032
void StartupXLOG(void)
Definition: xlog.c:6679
ArchiveMode
Definition: xlog.h:111
@ ARCHIVE_MODE_ALWAYS
Definition: xlog.h:114
@ ARCHIVE_MODE_OFF
Definition: xlog.h:112
@ ARCHIVE_MODE_ON
Definition: xlog.h:113
XLogRecPtr XactLastRecEnd
Definition: xlog.c:343
void StartupRequestWalReceiverRestart(void)
Definition: xlog.c:13055
bool CreateRestartPoint(int flags)
Definition: xlog.c:9649
char * PrimarySlotName
Definition: xlog.c:284
char * PromoteTriggerFile
Definition: xlog.c:285
XLogRecPtr GetInsertRecPtr(void)
Definition: xlog.c:8695
bool wal_init_zero
Definition: xlog.c:108
bool CheckPromoteSignal(void)
Definition: xlog.c:13206
int XLogArchiveMode
Definition: xlog.c:100
XLogRecPtr do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p, StringInfo labelfile, List **tablespaces, StringInfo tblspcmapfile)
Definition: xlog.c:10979
SessionBackupState get_backup_status(void)
Definition: xlog.c:11476
void CheckXLogRemoved(XLogSegNo segno, TimeLineID tli)
Definition: xlog.c:4054
char * recoveryRestoreCommand
Definition: xlog.c:268
void assign_checkpoint_completion_target(double newval, void *extra)
Definition: xlog.c:2388
WALAvailability
Definition: xlog.h:242
@ WALAVAIL_REMOVED
Definition: xlog.h:248
@ WALAVAIL_RESERVED
Definition: xlog.h:244
@ WALAVAIL_UNRESERVED
Definition: xlog.h:247
@ WALAVAIL_EXTENDED
Definition: xlog.h:245
@ WALAVAIL_INVALID_LSN
Definition: xlog.h:243
void SetRecoveryPause(bool recoveryPause)
Definition: xlog.c:6339
int wal_segment_size
Definition: xlog.c:123
char * archiveCleanupCommand
Definition: xlog.c:270
WALAvailability GetWALAvailability(XLogRecPtr targetLSN)
Definition: xlog.c:9906
int max_wal_size_mb
Definition: xlog.c:95
void XLOGShmemInit(void)
Definition: xlog.c:5233
void ShutdownXLOG(int code, Datum arg)
Definition: xlog.c:8798
RecoveryTargetType
Definition: xlog.h:37
@ RECOVERY_TARGET_IMMEDIATE
Definition: xlog.h:43
@ RECOVERY_TARGET_TIME
Definition: xlog.h:40
@ RECOVERY_TARGET_UNSET
Definition: xlog.h:38
@ RECOVERY_TARGET_XID
Definition: xlog.h:39
@ RECOVERY_TARGET_LSN
Definition: xlog.h:42
@ RECOVERY_TARGET_NAME
Definition: xlog.h:41
bool DataChecksumsEnabled(void)
Definition: xlog.c:5081
RecoveryState GetRecoveryState(void)
Definition: xlog.c:8439
int XLogArchiveTimeout
Definition: xlog.c:99
void WakeupRecovery(void)
Definition: xlog.c:13221
bool PromoteIsTriggered(void)
Definition: xlog.c:13117
TimestampTz GetCurrentChunkReplayStartTime(void)
Definition: xlog.c:6518
int XLogFileInit(XLogSegNo segno, TimeLineID tli)
Definition: xlog.c:3520
bool wal_recycle
Definition: xlog.c:109
bool HotStandbyActiveInReplay(void)
Definition: xlog.c:8485
char * GetMockAuthenticationNonce(void)
Definition: xlog.c:5071
void XLogSetReplicationSlotMinimumLSN(XLogRecPtr lsn)
Definition: xlog.c:2805
char * wal_consistency_checking_string
Definition: xlog.c:106
WalCompression
Definition: xlog.h:128
@ WAL_COMPRESSION_NONE
Definition: xlog.h:129
@ WAL_COMPRESSION_LZ4
Definition: xlog.h:131
@ WAL_COMPRESSION_PGLZ
Definition: xlog.h:130
XLogRecPtr GetXLogInsertRecPtr(void)
Definition: xlog.c:11984
Size XLOGShmemSize(void)
Definition: xlog.c:5192
void SetWalWriterSleeping(bool sleeping)
Definition: xlog.c:13230
bool wal_log_hints
Definition: xlog.c:104
char * recovery_target_time_string
Definition: xlog.c:275
struct CheckpointStatsData CheckpointStatsData
int XLogFileOpen(XLogSegNo segno, TimeLineID tli)
Definition: xlog.c:3760
int max_slot_wal_keep_size_mb
Definition: xlog.c:116
XLogRecPtr GetFlushRecPtr(TimeLineID *insertTLI)
Definition: xlog.c:8712
bool StandbyMode
Definition: xlog.c:289
void XLogSetAsyncXactLSN(XLogRecPtr record)
Definition: xlog.c:2764
bool log_checkpoints
Definition: xlog.c:110
XLogRecPtr recoveryTargetLSN
Definition: xlog.c:278
RecoveryTargetType recoveryTarget
Definition: xlog.c:271
XLogRecPtr GetXLogReplayRecPtr(TimeLineID *replayTLI)
Definition: xlog.c:11965
void GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream)
Definition: xlog.c:6534
XLogRecPtr do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
Definition: xlog.c:11497
void assign_max_wal_size(int newval, void *extra)
Definition: xlog.c:2381
XLogRecPtr GetLastImportantRecPtr(void)
Definition: xlog.c:8752
void xlog_redo(XLogReaderState *record)
Definition: xlog.c:10301
RecoveryTargetTimeLineGoal
Definition: xlog.h:50
@ RECOVERY_TARGET_TIMELINE_NUMERIC
Definition: xlog.h:53
@ RECOVERY_TARGET_TIMELINE_CONTROLFILE
Definition: xlog.h:51
@ RECOVERY_TARGET_TIMELINE_LATEST
Definition: xlog.h:52
SessionBackupState
Definition: xlog.h:341
@ SESSION_BACKUP_EXCLUSIVE
Definition: xlog.h:343
@ SESSION_BACKUP_NON_EXCLUSIVE
Definition: xlog.h:344
@ SESSION_BACKUP_NONE
Definition: xlog.h:342
void register_persistent_abort_backup_handler(void)
Definition: xlog.c:11949
void LocalProcessControlFile(bool reset)
Definition: xlog.c:5181
RecoveryPauseState
Definition: xlog.h:144
@ RECOVERY_PAUSED
Definition: xlog.h:147
@ RECOVERY_NOT_PAUSED
Definition: xlog.h:145
@ RECOVERY_PAUSE_REQUESTED
Definition: xlog.h:146
int wal_compression
Definition: xlog.c:105
TransactionId recoveryTargetXid
Definition: xlog.c:274
void BootStrapXLOG(void)
Definition: xlog.c:5346
TimeLineID recoveryTargetTLIRequested
Definition: xlog.c:322
XLogRecPtr GetXLogWriteRecPtr(void)
Definition: xlog.c:12000
int wal_retrieve_retry_interval
Definition: xlog.c:115
int XLOGbuffers
Definition: xlog.c:98
bool XLogBackgroundFlush(void)
Definition: xlog.c:3113
bool track_wal_io_timing
Definition: xlog.c:117
bool wal_receiver_create_temp_slot
Definition: xlog.c:286
char * recoveryEndCommand
Definition: xlog.c:269
RecoveryPauseState GetRecoveryPauseState(void)
Definition: xlog.c:6319
bool XLogInsertAllowed(void)
Definition: xlog.c:8499
TimeLineID recoveryTargetTLI
Definition: xlog.c:323
XLogRecPtr XLogRestorePoint(const char *rpName)
Definition: xlog.c:10101
const char * xlog_identify(uint8 info)
Definition: xlogdesc.c:154
int min_wal_size_mb
Definition: xlog.c:96
WalLevel
Definition: xlog.h:120
@ WAL_LEVEL_REPLICA
Definition: xlog.h:122
@ WAL_LEVEL_LOGICAL
Definition: xlog.h:123
@ WAL_LEVEL_MINIMAL
Definition: xlog.h:121
TimestampTz GetLatestXTime(void)
Definition: xlog.c:6488
int sync_method
Definition: xlog.c:111
char * PrimaryConnInfo
Definition: xlog.c:283
void XLogRequestWalReceiverReply(void)
Definition: xlog.c:13241
CheckpointStatsData CheckpointStats
Definition: xlog.c:192
XLogRecPtr GetFakeLSNForUnloggedRel(void)
Definition: xlog.c:5097
void XLogPutNextOid(Oid nextOid)
Definition: xlog.c:10046
bool StandbyModeRequested
Definition: xlog.c:282
PGDLLIMPORT XLogRecPtr XactLastCommitEnd
Definition: xlog.c:344
bool recoveryTargetInclusive
Definition: xlog.c:272
void UpdateControlFile(void)
Definition: xlog.c:5052
void RemovePromoteSignalFiles(void)
Definition: xlog.c:13197
PGDLLIMPORT int wal_level
Definition: xlog.c:112
RecoveryState
Definition: xlog.h:136
@ RECOVERY_STATE_CRASH
Definition: xlog.h:137
@ RECOVERY_STATE_DONE
Definition: xlog.h:139
@ RECOVERY_STATE_ARCHIVE
Definition: xlog.h:138
int CheckPointSegments
Definition: xlog.c:136
void CreateCheckPoint(int flags)
Definition: xlog.c:9064
void issue_xlog_fsync(int fd, XLogSegNo segno, TimeLineID tli)
Definition: xlog.c:10858
bool * wal_consistency_checking
Definition: xlog.c:107
uint64 XLogRecPtr
Definition: xlogdefs.h:21
uint32 TimeLineID
Definition: xlogdefs.h:59
uint64 XLogSegNo
Definition: xlogdefs.h:48