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-2020, 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 extern PGDLLIMPORT TimeLineID ThisTimeLineID; /* current TLI */
33 
34 /*
35  * Prior to 8.4, all activity during recovery was carried out by the startup
36  * process. This local variable continues to be used in many parts of the
37  * code to indicate actions taken by RecoveryManagers. Other processes that
38  * potentially perform work during recovery should check RecoveryInProgress().
39  * See XLogCtl notes in xlog.c.
40  */
41 extern bool InRecovery;
42 
43 /*
44  * Like InRecovery, standbyState is only valid in the startup process.
45  * In all other processes it will have the value STANDBY_DISABLED (so
46  * InHotStandby will read as false).
47  *
48  * In DISABLED state, we're performing crash recovery or hot standby was
49  * disabled in postgresql.conf.
50  *
51  * In INITIALIZED state, we've run InitRecoveryTransactionEnvironment, but
52  * we haven't yet processed a RUNNING_XACTS or shutdown-checkpoint WAL record
53  * to initialize our primary-transaction tracking system.
54  *
55  * When the transaction tracking is initialized, we enter the SNAPSHOT_PENDING
56  * state. The tracked information might still be incomplete, so we can't allow
57  * connections yet, but redo functions must update the in-memory state when
58  * appropriate.
59  *
60  * In SNAPSHOT_READY mode, we have full knowledge of transactions that are
61  * (or were) running on the primary at the current WAL location. Snapshots
62  * can be taken, and read-only queries can be run.
63  */
64 typedef enum
65 {
71 
73 
74 #define InHotStandby (standbyState >= STANDBY_SNAPSHOT_PENDING)
75 
76 /*
77  * Recovery target type.
78  * Only set during a Point in Time recovery, not when in standby mode.
79  */
80 typedef enum
81 {
89 
90 /*
91  * Recovery target TimeLine goal
92  */
93 typedef enum
94 {
99 
103 
104 extern bool reachedConsistency;
105 
106 /* these variables are GUC parameters related to XLOG */
107 extern int wal_segment_size;
108 extern int min_wal_size_mb;
109 extern int max_wal_size_mb;
110 extern int wal_keep_size_mb;
111 extern int max_slot_wal_keep_size_mb;
112 extern int XLOGbuffers;
113 extern int XLogArchiveTimeout;
114 extern int wal_retrieve_retry_interval;
115 extern char *XLogArchiveCommand;
116 extern bool EnableHotStandby;
117 extern bool fullPageWrites;
118 extern bool wal_log_hints;
119 extern bool wal_compression;
120 extern bool wal_init_zero;
121 extern bool wal_recycle;
122 extern bool *wal_consistency_checking;
124 extern bool log_checkpoints;
125 extern char *recoveryRestoreCommand;
126 extern char *recoveryEndCommand;
127 extern char *archiveCleanupCommand;
128 extern bool recoveryTargetInclusive;
129 extern int recoveryTargetAction;
130 extern int recovery_min_apply_delay;
131 extern char *PrimaryConnInfo;
132 extern char *PrimarySlotName;
134 
135 /* indirectly set via GUC system */
137 extern char *recovery_target_time_string;
138 extern const char *recoveryTargetName;
141 extern char *PromoteTriggerFile;
145 
146 extern int CheckPointSegments;
147 
148 /* option set locally in startup process only when signal files exist */
149 extern bool StandbyModeRequested;
150 extern bool StandbyMode;
151 
152 /* Archive modes */
153 typedef enum ArchiveMode
154 {
155  ARCHIVE_MODE_OFF = 0, /* disabled */
156  ARCHIVE_MODE_ON, /* enabled while server is running normally */
157  ARCHIVE_MODE_ALWAYS /* enabled always (even during recovery) */
158 } ArchiveMode;
159 extern int XLogArchiveMode;
160 
161 /* WAL levels */
162 typedef enum WalLevel
163 {
167 } WalLevel;
168 
169 /* Recovery states */
170 typedef enum RecoveryState
171 {
172  RECOVERY_STATE_CRASH = 0, /* crash recovery */
173  RECOVERY_STATE_ARCHIVE, /* archive recovery */
174  RECOVERY_STATE_DONE /* currently in production */
175 } RecoveryState;
176 
177 extern PGDLLIMPORT int wal_level;
178 
179 /* Is WAL archiving enabled (always or only while server is running normally)? */
180 #define XLogArchivingActive() \
181  (AssertMacro(XLogArchiveMode == ARCHIVE_MODE_OFF || wal_level >= WAL_LEVEL_REPLICA), XLogArchiveMode > ARCHIVE_MODE_OFF)
182 /* Is WAL archiving enabled always (even during recovery)? */
183 #define XLogArchivingAlways() \
184  (AssertMacro(XLogArchiveMode == ARCHIVE_MODE_OFF || wal_level >= WAL_LEVEL_REPLICA), XLogArchiveMode == ARCHIVE_MODE_ALWAYS)
185 #define XLogArchiveCommandSet() (XLogArchiveCommand[0] != '\0')
186 
187 /*
188  * Is WAL-logging necessary for archival or log-shipping, or can we skip
189  * WAL-logging if we fsync() the data before committing instead?
190  */
191 #define XLogIsNeeded() (wal_level >= WAL_LEVEL_REPLICA)
192 
193 /*
194  * Is a full-page image needed for hint bit updates?
195  *
196  * Normally, we don't WAL-log hint bit updates, but if checksums are enabled,
197  * we have to protect them against torn page writes. When you only set
198  * individual bits on a page, it's still consistent no matter what combination
199  * of the bits make it to disk, but the checksum wouldn't match. Also WAL-log
200  * them if forced by wal_log_hints=on.
201  */
202 #define XLogHintBitIsNeeded() (DataChecksumsEnabled() || wal_log_hints)
203 
204 /* Do we need to WAL-log information required only for Hot Standby and logical replication? */
205 #define XLogStandbyInfoActive() (wal_level >= WAL_LEVEL_REPLICA)
206 
207 /* Do we need to WAL-log information required only for logical replication? */
208 #define XLogLogicalInfoActive() (wal_level >= WAL_LEVEL_LOGICAL)
209 
210 #ifdef WAL_DEBUG
211 extern bool XLOG_DEBUG;
212 #endif
213 
214 /*
215  * OR-able request flag bits for checkpoints. The "cause" bits are used only
216  * for logging purposes. Note: the flags must be defined so that it's
217  * sensible to OR together request flags arising from different requestors.
218  */
219 
220 /* These directly affect the behavior of CreateCheckPoint and subsidiaries */
221 #define CHECKPOINT_IS_SHUTDOWN 0x0001 /* Checkpoint is for shutdown */
222 #define CHECKPOINT_END_OF_RECOVERY 0x0002 /* Like shutdown checkpoint, but
223  * issued at end of WAL recovery */
224 #define CHECKPOINT_IMMEDIATE 0x0004 /* Do it without delays */
225 #define CHECKPOINT_FORCE 0x0008 /* Force even if no activity */
226 #define CHECKPOINT_FLUSH_ALL 0x0010 /* Flush all pages, including those
227  * belonging to unlogged tables */
228 /* These are important to RequestCheckpoint */
229 #define CHECKPOINT_WAIT 0x0020 /* Wait for completion */
230 #define CHECKPOINT_REQUESTED 0x0040 /* Checkpoint request has been made */
231 /* These indicate the cause of a checkpoint request */
232 #define CHECKPOINT_CAUSE_XLOG 0x0080 /* XLOG consumption */
233 #define CHECKPOINT_CAUSE_TIME 0x0100 /* Elapsed time */
234 
235 /*
236  * Flag bits for the record being inserted, set using XLogSetRecordFlags().
237  */
238 #define XLOG_INCLUDE_ORIGIN 0x01 /* include the replication origin */
239 #define XLOG_MARK_UNIMPORTANT 0x02 /* record not important for durability */
240 #define XLOG_INCLUDE_XID 0x04 /* include XID of top-level xact */
241 
242 
243 /* Checkpoint statistics */
244 typedef struct CheckpointStatsData
245 {
246  TimestampTz ckpt_start_t; /* start of checkpoint */
247  TimestampTz ckpt_write_t; /* start of flushing buffers */
248  TimestampTz ckpt_sync_t; /* start of fsyncs */
249  TimestampTz ckpt_sync_end_t; /* end of fsyncs */
250  TimestampTz ckpt_end_t; /* end of checkpoint */
251 
252  int ckpt_bufs_written; /* # of buffers written */
253 
254  int ckpt_segs_added; /* # of new xlog segments created */
255  int ckpt_segs_removed; /* # of xlog segments deleted */
256  int ckpt_segs_recycled; /* # of xlog segments recycled */
257 
258  int ckpt_sync_rels; /* # of relations synced */
259  uint64 ckpt_longest_sync; /* Longest sync for one relation */
260  uint64 ckpt_agg_sync_time; /* The sum of all the individual sync
261  * times, which is not necessarily the
262  * same as the total elapsed time for the
263  * entire sync phase. */
265 
267 
268 /*
269  * GetWALAvailability return codes
270  */
271 typedef enum WALAvailability
272 {
273  WALAVAIL_INVALID_LSN, /* parameter error */
274  WALAVAIL_RESERVED, /* WAL segment is within max_wal_size */
275  WALAVAIL_EXTENDED, /* WAL segment is reserved by a slot or
276  * wal_keep_size */
277  WALAVAIL_UNRESERVED, /* no longer reserved, but not removed yet */
278  WALAVAIL_REMOVED /* WAL segment has been removed */
280 
281 struct XLogRecData;
282 
283 extern XLogRecPtr XLogInsertRecord(struct XLogRecData *rdata,
284  XLogRecPtr fpw_lsn,
285  uint8 flags,
286  int num_fpi);
287 extern void XLogFlush(XLogRecPtr RecPtr);
288 extern bool XLogBackgroundFlush(void);
289 extern bool XLogNeedsFlush(XLogRecPtr RecPtr);
290 extern int XLogFileInit(XLogSegNo segno, bool *use_existent, bool use_lock);
291 extern int XLogFileOpen(XLogSegNo segno);
292 
293 extern void CheckXLogRemoved(XLogSegNo segno, TimeLineID tli);
295 extern void XLogSetAsyncXactLSN(XLogRecPtr record);
297 
298 extern void xlog_redo(XLogReaderState *record);
299 extern void xlog_desc(StringInfo buf, XLogReaderState *record);
300 extern const char *xlog_identify(uint8 info);
301 
302 extern void issue_xlog_fsync(int fd, XLogSegNo segno);
303 
304 extern bool RecoveryInProgress(void);
305 extern RecoveryState GetRecoveryState(void);
306 extern bool HotStandbyActive(void);
307 extern bool HotStandbyActiveInReplay(void);
308 extern bool XLogInsertAllowed(void);
309 extern void GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream);
310 extern XLogRecPtr GetXLogReplayRecPtr(TimeLineID *replayTLI);
311 extern XLogRecPtr GetXLogInsertRecPtr(void);
312 extern XLogRecPtr GetXLogWriteRecPtr(void);
313 extern bool RecoveryIsPaused(void);
314 extern void SetRecoveryPause(bool recoveryPause);
315 extern TimestampTz GetLatestXTime(void);
317 
318 extern void UpdateControlFile(void);
319 extern uint64 GetSystemIdentifier(void);
320 extern char *GetMockAuthenticationNonce(void);
321 extern bool DataChecksumsEnabled(void);
323 extern Size XLOGShmemSize(void);
324 extern void XLOGShmemInit(void);
325 extern void BootStrapXLOG(void);
326 extern void LocalProcessControlFile(bool reset);
327 extern void StartupXLOG(void);
328 extern void ShutdownXLOG(int code, Datum arg);
329 extern void InitXLOGAccess(void);
330 extern void CreateCheckPoint(int flags);
331 extern bool CreateRestartPoint(int flags);
334 extern void XLogPutNextOid(Oid nextOid);
335 extern XLogRecPtr XLogRestorePoint(const char *rpName);
336 extern void UpdateFullPageWrites(void);
337 extern void GetFullPageWriteInfo(XLogRecPtr *RedoRecPtr_p, bool *doPageWrites_p);
338 extern XLogRecPtr GetRedoRecPtr(void);
339 extern XLogRecPtr GetInsertRecPtr(void);
340 extern XLogRecPtr GetFlushRecPtr(void);
342 extern void RemovePromoteSignalFiles(void);
343 
344 extern bool PromoteIsTriggered(void);
345 extern bool CheckPromoteSignal(void);
346 extern void WakeupRecovery(void);
347 extern void SetWalWriterSleeping(bool sleeping);
348 
349 extern void StartupRequestWalReceiverRestart(void);
350 extern void XLogRequestWalReceiverReply(void);
351 
352 extern void assign_max_wal_size(int newval, void *extra);
353 extern void assign_checkpoint_completion_target(double newval, void *extra);
354 
355 /*
356  * Routines to start, stop, and get status of a base backup.
357  */
358 
359 /*
360  * Session-level status of base backups
361  *
362  * This is used in parallel with the shared memory status to control parallel
363  * execution of base backup functions for a given session, be it a backend
364  * dedicated to replication or a normal backend connected to a database. The
365  * update of the session-level status happens at the same time as the shared
366  * memory counters to keep a consistent global and local state of the backups
367  * running.
368  */
369 typedef enum SessionBackupState
370 {
375 
376 extern XLogRecPtr do_pg_start_backup(const char *backupidstr, bool fast,
377  TimeLineID *starttli_p, StringInfo labelfile,
378  List **tablespaces, StringInfo tblspcmapfile,
379  bool needtblspcmapfile);
380 extern XLogRecPtr do_pg_stop_backup(char *labelfile, bool waitforarchive,
381  TimeLineID *stoptli_p);
382 extern void do_pg_abort_backup(int code, Datum arg);
385 
386 /* File path names (all relative to $PGDATA) */
387 #define RECOVERY_SIGNAL_FILE "recovery.signal"
388 #define STANDBY_SIGNAL_FILE "standby.signal"
389 #define BACKUP_LABEL_FILE "backup_label"
390 #define BACKUP_LABEL_OLD "backup_label.old"
391 
392 #define TABLESPACE_MAP "tablespace_map"
393 #define TABLESPACE_MAP_OLD "tablespace_map.old"
394 
395 /* files to signal promotion to primary */
396 #define PROMOTE_SIGNAL_FILE "promote"
397 
398 #endif /* XLOG_H */
void CreateCheckPoint(int flags)
Definition: xlog.c:8701
struct CheckpointStatsData CheckpointStatsData
XLogRecPtr GetXLogWriteRecPtr(void)
Definition: xlog.c:11510
uint64 ckpt_agg_sync_time
Definition: xlog.h:260
TimeLineID recoveryTargetTLI
Definition: xlog.c:340
const char * recoveryTargetName
Definition: xlog.c:288
TimestampTz ckpt_sync_end_t
Definition: xlog.h:249
bool CreateRestartPoint(int flags)
Definition: xlog.c:9242
int ckpt_sync_rels
Definition: xlog.h:258
bool XLogInsertAllowed(void)
Definition: xlog.c:8182
bool recoveryTargetInclusive
Definition: xlog.c:283
char * recovery_target_time_string
Definition: xlog.c:286
int min_wal_size_mb
Definition: xlog.c:90
bool XLogNeedsFlush(XLogRecPtr RecPtr)
Definition: xlog.c:3165
uint32 TimeLineID
Definition: xlogdefs.h:52
XLogRecPtr GetRedoRecPtr(void)
Definition: xlog.c:8361
int wal_keep_size_mb
Definition: xlog.c:91
bool DataChecksumsEnabled(void)
Definition: xlog.c:4930
bool wal_receiver_create_temp_slot
Definition: xlog.c:297
void WakeupRecovery(void)
Definition: xlog.c:12649
uint32 TransactionId
Definition: c.h:520
void XLogFlush(XLogRecPtr RecPtr)
Definition: xlog.c:2844
void xlog_desc(StringInfo buf, XLogReaderState *record)
Definition: xlogdesc.c:37
bool HotStandbyActive(void)
Definition: xlog.c:8143
int64 TimestampTz
Definition: timestamp.h:39
int XLogFileOpen(XLogSegNo segno)
Definition: xlog.c:3643
int recoveryTargetAction
Definition: xlog.c:284
WALAvailability
Definition: xlog.h:271
WALAvailability GetWALAvailability(XLogRecPtr targetLSN)
Definition: xlog.c:9507
TimestampTz ckpt_start_t
Definition: xlog.h:246
XLogRecPtr XactLastRecEnd
Definition: xlog.c:360
RecoveryTargetTimeLineGoal
Definition: xlog.h:93
bool wal_log_hints
Definition: xlog.c:98
void LocalProcessControlFile(bool reset)
Definition: xlog.c:5030
unsigned char uint8
Definition: c.h:372
char * GetMockAuthenticationNonce(void)
Definition: xlog.c:4920
int ckpt_segs_recycled
Definition: xlog.h:256
bool fullPageWrites
Definition: xlog.c:97
XLogSegNo XLogGetLastRemovedSegno(void)
Definition: xlog.c:3956
int max_wal_size_mb
Definition: xlog.c:89
RecoveryState GetRecoveryState(void)
Definition: xlog.c:8122
char * wal_consistency_checking_string
Definition: xlog.c:100
unsigned int Oid
Definition: postgres_ext.h:31
void SetRecoveryPause(bool recoveryPause)
Definition: xlog.c:6049
bool CheckPromoteSignal(void)
Definition: xlog.c:12634
XLogRecPtr GetXLogReplayRecPtr(TimeLineID *replayTLI)
Definition: xlog.c:11475
static int fd(const char *x, int i)
Definition: preproc-init.c:105
void UpdateFullPageWrites(void)
Definition: xlog.c:9784
char * recoveryRestoreCommand
Definition: xlog.c:279
RecoveryTargetTimeLineGoal recoveryTargetTimeLineGoal
Definition: xlog.c:338
bool XLogBackgroundFlush(void)
Definition: xlog.c:3033
#define PGDLLIMPORT
Definition: c.h:1257
void xlog_redo(XLogReaderState *record)
Definition: xlog.c:9896
bool wal_init_zero
Definition: xlog.c:102
void XLogSetReplicationSlotMinimumLSN(XLogRecPtr lsn)
Definition: xlog.c:2723
void XLogSetAsyncXactLSN(XLogRecPtr record)
Definition: xlog.c:2682
void CheckXLogRemoved(XLogSegNo segno, TimeLineID tli)
Definition: xlog.c:3925
XLogRecPtr GetInsertRecPtr(void)
Definition: xlog.c:8405
bool reachedConsistency
Definition: xlog.c:869
bool wal_compression
Definition: xlog.c:99
void assign_checkpoint_completion_target(double newval, void *extra)
Definition: xlog.c:2327
bool * wal_consistency_checking
Definition: xlog.c:101
bool PromoteIsTriggered(void)
Definition: xlog.c:12553
void UpdateControlFile(void)
Definition: xlog.c:4901
int XLogArchiveTimeout
Definition: xlog.c:93
int XLogArchiveMode
Definition: xlog.c:94
const char * xlog_identify(uint8 info)
Definition: xlogdesc.c:146
char * recoveryEndCommand
Definition: xlog.c:280
void InitXLOGAccess(void)
Definition: xlog.c:8335
HotStandbyState standbyState
Definition: xlog.c:207
SessionBackupState
Definition: xlog.h:369
char * PrimaryConnInfo
Definition: xlog.c:294
PGDLLIMPORT int wal_level
Definition: xlog.c:106
bool EnableHotStandby
Definition: xlog.c:96
static char * buf
Definition: pg_test_fsync.c:67
XLogRecPtr GetXLogInsertRecPtr(void)
Definition: xlog.c:11494
int XLOGbuffers
Definition: xlog.c:92
uint64 XLogSegNo
Definition: xlogdefs.h:41
RecoveryTargetType recoveryTarget
Definition: xlog.c:282
char * PromoteTriggerFile
Definition: xlog.c:296
RecoveryTargetType
Definition: xlog.h:80
void RemovePromoteSignalFiles(void)
Definition: xlog.c:12625
int ckpt_segs_removed
Definition: xlog.h:255
bool log_checkpoints
Definition: xlog.c:104
bool StandbyMode
Definition: xlog.c:300
XLogRecPtr GetFlushRecPtr(void)
Definition: xlog.c:8421
int max_slot_wal_keep_size_mb
Definition: xlog.c:110
int recovery_min_apply_delay
Definition: xlog.c:290
int ckpt_bufs_written
Definition: xlog.h:252
void register_persistent_abort_backup_handler(void)
Definition: xlog.c:11459
void StartupXLOG(void)
Definition: xlog.c:6302
int wal_segment_size
Definition: xlog.c:116
bool HotStandbyActiveInReplay(void)
Definition: xlog.c:8168
int CheckPointSegments
Definition: xlog.c:129
uintptr_t Datum
Definition: postgres.h:367
bool StandbyModeRequested
Definition: xlog.c:293
SessionBackupState get_backup_status(void)
Definition: xlog.c:10993
void issue_xlog_fsync(int fd, XLogSegNo segno)
Definition: xlog.c:10403
XLogRecPtr ProcLastRecPtr
Definition: xlog.c:359
bool InRecovery
Definition: xlog.c:204
TimestampTz GetCurrentChunkReplayStartTime(void)
Definition: xlog.c:6203
XLogRecPtr GetLastImportantRecPtr(void)
Definition: xlog.c:8439
int XLogFileInit(XLogSegNo segno, bool *use_existent, bool use_lock)
Definition: xlog.c:3251
int sync_method
Definition: xlog.c:105
uint64 XLogRecPtr
Definition: xlogdefs.h:21
XLogRecPtr do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
Definition: xlog.c:11014
PGDLLIMPORT XLogRecPtr XactLastCommitEnd
Definition: xlog.c:361
void SetWalWriterSleeping(bool sleeping)
Definition: xlog.c:12658
void ShutdownXLOG(int code, Datum arg)
Definition: xlog.c:8485
XLogRecPtr GetFakeLSNForUnloggedRel(void)
Definition: xlog.c:4946
void assign_max_wal_size(int newval, void *extra)
Definition: xlog.c:2320
ArchiveMode
Definition: xlog.h:153
size_t Size
Definition: c.h:473
TimestampTz GetLatestXTime(void)
Definition: xlog.c:6173
TimestampTz ckpt_write_t
Definition: xlog.h:247
#define newval
void XLogRequestWalReceiverReply(void)
Definition: xlog.c:12669
XLogRecPtr XLogRestorePoint(const char *rpName)
Definition: xlog.c:9696
Size XLOGShmemSize(void)
Definition: xlog.c:5041
bool RecoveryInProgress(void)
Definition: xlog.c:8069
TransactionId recoveryTargetXid
Definition: xlog.c:285
TimestampTz ckpt_sync_t
Definition: xlog.h:248
void do_pg_abort_backup(int code, Datum arg)
Definition: xlog.c:11427
XLogRecPtr recoveryTargetLSN
Definition: xlog.c:289
int ckpt_segs_added
Definition: xlog.h:254
void XLOGShmemInit(void)
Definition: xlog.c:5082
XLogRecPtr do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p, StringInfo labelfile, List **tablespaces, StringInfo tblspcmapfile, bool needtblspcmapfile)
Definition: xlog.c:10496
bool RecoveryIsPaused(void)
Definition: xlog.c:6037
char * archiveCleanupCommand
Definition: xlog.c:281
bool wal_recycle
Definition: xlog.c:103
void * arg
CheckpointStatsData CheckpointStats
Definition: xlog.c:185
PGDLLIMPORT TimeLineID ThisTimeLineID
Definition: xlog.c:191
XLogRecPtr XLogInsertRecord(struct XLogRecData *rdata, XLogRecPtr fpw_lsn, uint8 flags, int num_fpi)
Definition: xlog.c:998
void GetFullPageWriteInfo(XLogRecPtr *RedoRecPtr_p, bool *doPageWrites_p)
Definition: xlog.c:8390
RecoveryState
Definition: xlog.h:170
int wal_retrieve_retry_interval
Definition: xlog.c:109
void StartupRequestWalReceiverRestart(void)
Definition: xlog.c:12502
void BootStrapXLOG(void)
Definition: xlog.c:5193
void XLogPutNextOid(Oid nextOid)
Definition: xlog.c:9641
Definition: pg_list.h:50
void GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream)
Definition: xlog.c:6219
uint64 GetSystemIdentifier(void)
Definition: xlog.c:4910
XLogRecPtr CalculateMaxmumSafeLSN(void)
TimeLineID recoveryTargetTLIRequested
Definition: xlog.c:339
TimestampTz ckpt_end_t
Definition: xlog.h:250
HotStandbyState
Definition: xlog.h:64
WalLevel
Definition: xlog.h:162
uint64 ckpt_longest_sync
Definition: xlog.h:259
char * XLogArchiveCommand
Definition: xlog.c:95
char * PrimarySlotName
Definition: xlog.c:295