25 #define SYNC_METHOD_FSYNC 0
26 #define SYNC_METHOD_FDATASYNC 1
27 #define SYNC_METHOD_OPEN 2
28 #define SYNC_METHOD_FSYNC_WRITETHROUGH 3
29 #define SYNC_METHOD_OPEN_DSYNC 4
74 #define InHotStandby (standbyState >= STANDBY_SNAPSHOT_PENDING)
130 #define XLogArchivingActive() \
131 (XLogArchiveMode > ARCHIVE_MODE_OFF && wal_level >= WAL_LEVEL_ARCHIVE)
133 #define XLogArchivingAlways() \
134 (XLogArchiveMode == ARCHIVE_MODE_ALWAYS && wal_level >= WAL_LEVEL_ARCHIVE)
135 #define XLogArchiveCommandSet() (XLogArchiveCommand[0] != '\0')
141 #define XLogIsNeeded() (wal_level >= WAL_LEVEL_ARCHIVE)
152 #define XLogHintBitIsNeeded() (DataChecksumsEnabled() || wal_log_hints)
155 #define XLogStandbyInfoActive() (wal_level >= WAL_LEVEL_HOT_STANDBY)
158 #define XLogLogicalInfoActive() (wal_level >= WAL_LEVEL_LOGICAL)
161 extern bool XLOG_DEBUG;
171 #define CHECKPOINT_IS_SHUTDOWN 0x0001
172 #define CHECKPOINT_END_OF_RECOVERY 0x0002
175 #define CHECKPOINT_IMMEDIATE 0x0004
176 #define CHECKPOINT_FORCE 0x0008
177 #define CHECKPOINT_FLUSH_ALL 0x0010
180 #define CHECKPOINT_WAIT 0x0020
182 #define CHECKPOINT_CAUSE_XLOG 0x0040
183 #define CHECKPOINT_CAUSE_TIME 0x0080
278 List **tablespaces,
char **tblspcmapfile,
bool infotbssize,
279 bool needtblspcmapfile);
285 #define BACKUP_LABEL_FILE "backup_label"
286 #define BACKUP_LABEL_OLD "backup_label.old"
288 #define TABLESPACE_MAP "tablespace_map"
289 #define TABLESPACE_MAP_OLD "tablespace_map.old"
void CreateCheckPoint(int flags)
struct CheckpointStatsData CheckpointStatsData
XLogRecPtr GetXLogWriteRecPtr(void)
uint64 ckpt_agg_sync_time
TimestampTz ckpt_sync_end_t
bool CreateRestartPoint(int flags)
bool XLogInsertAllowed(void)
bool XLogNeedsFlush(XLogRecPtr RecPtr)
XLogRecPtr do_pg_start_backup(const char *backupidstr, bool fast, TimeLineID *starttli_p, char **labelfile, DIR *tblspcdir, List **tablespaces, char **tblspcmapfile, bool infotbssize, bool needtblspcmapfile)
XLogRecPtr GetRedoRecPtr(void)
bool DataChecksumsEnabled(void)
void WakeupRecovery(void)
void XLogFlush(XLogRecPtr RecPtr)
void xlog_desc(StringInfo buf, XLogReaderState *record)
bool HotStandbyActive(void)
int XLogFileOpen(XLogSegNo segno)
XLogRecPtr XactLastRecEnd
XLogSegNo XLogGetLastRemovedSegno(void)
void GetNextXidAndEpoch(TransactionId *xid, uint32 *epoch)
void SetRecoveryPause(bool recoveryPause)
bool CheckPromoteSignal(void)
XLogRecPtr GetXLogReplayRecPtr(TimeLineID *replayTLI)
static int fd(const char *x, int i)
void UpdateFullPageWrites(void)
bool XLogBackgroundFlush(void)
void xlog_redo(XLogReaderState *record)
char * XLogFileNameP(TimeLineID tli, XLogSegNo segno)
void XLogSetReplicationSlotMinimumLSN(XLogRecPtr lsn)
void XLogSetAsyncXactLSN(XLogRecPtr record)
void CheckXLogRemoved(XLogSegNo segno, TimeLineID tli)
XLogRecPtr GetInsertRecPtr(void)
void assign_checkpoint_completion_target(double newval, void *extra)
void UpdateControlFile(void)
const char * xlog_identify(uint8 info)
void InitXLOGAccess(void)
HotStandbyState standbyState
XLogRecPtr GetXLogInsertRecPtr(void)
XLogRecPtr XLogInsertRecord(struct XLogRecData *rdata, XLogRecPtr fpw_lsn)
void RemovePromoteSignalFiles(void)
XLogRecPtr GetFlushRecPtr(void)
bool HotStandbyActiveInReplay(void)
void issue_xlog_fsync(int fd, XLogSegNo segno)
TimestampTz GetCurrentChunkReplayStartTime(void)
int XLogFileInit(XLogSegNo segno, bool *use_existent, bool use_lock)
XLogRecPtr do_pg_stop_backup(char *labelfile, bool waitforarchive, TimeLineID *stoptli_p)
PGDLLIMPORT XLogRecPtr XactLastCommitEnd
void SetWalWriterSleeping(bool sleeping)
void ShutdownXLOG(int code, Datum arg)
XLogRecPtr GetFakeLSNForUnloggedRel(void)
void do_pg_abort_backup(void)
void assign_max_wal_size(int newval, void *extra)
TimestampTz GetLatestXTime(void)
XLogRecPtr XLogRestorePoint(const char *rpName)
bool RecoveryInProgress(void)
bool RecoveryIsPaused(void)
static const unsigned __int64 epoch
CheckpointStatsData CheckpointStats
PGDLLIMPORT TimeLineID ThisTimeLineID
void GetFullPageWriteInfo(XLogRecPtr *RedoRecPtr_p, bool *doPageWrites_p)
int wal_retrieve_retry_interval
void XLogPutNextOid(Oid nextOid)
void GetXLogReceiptTime(TimestampTz *rtime, bool *fromStream)
uint64 GetSystemIdentifier(void)
char * XLogArchiveCommand