|
PostgreSQL Source Code git master
|
#include "access/xlogdefs.h"#include "access/xlogreader.h"#include "datatype/timestamp.h"#include "lib/stringinfo.h"#include "pgtime.h"#include "storage/block.h"#include "storage/relfilelocator.h"

Go to the source code of this file.
Data Structures | |
| struct | XLogPageHeaderData |
| struct | XLogLongPageHeaderData |
| struct | xl_parameter_change |
| struct | xl_restore_point |
| struct | xl_overwrite_contrecord |
| struct | xl_end_of_recovery |
| struct | XLogRecData |
| struct | RmgrData |
Variables | |
| PGDLLIMPORT RmgrData | RmgrTable [] |
| PGDLLIMPORT bool | ArchiveRecoveryRequested |
| PGDLLIMPORT bool | InArchiveRecovery |
| PGDLLIMPORT bool | StandbyMode |
| PGDLLIMPORT char * | recoveryRestoreCommand |
| #define DEFAULT_MAX_WAL_SEGS 64 |
Definition at line 90 of file xlog_internal.h.
| #define DEFAULT_MIN_WAL_SEGS 5 |
Definition at line 89 of file xlog_internal.h.
Definition at line 93 of file xlog_internal.h.
| #define IsValidWalSegSize | ( | size | ) |
Definition at line 94 of file xlog_internal.h.
| #define MAXFNAMELEN 64 |
Definition at line 154 of file xlog_internal.h.
| #define SizeOfXLogLongPHD MAXALIGN(sizeof(XLogLongPageHeaderData)) |
Definition at line 69 of file xlog_internal.h.
| #define SizeOfXLogShortPHD MAXALIGN(sizeof(XLogPageHeaderData)) |
Definition at line 52 of file xlog_internal.h.
| #define WalSegMaxSize 1024 * 1024 * 1024 |
Definition at line 87 of file xlog_internal.h.
| #define WalSegMinSize 1024 * 1024 |
Definition at line 86 of file xlog_internal.h.
| #define XLByteInPrevSeg | ( | xlrp, | |
| logSegNo, | |||
| wal_segsz_bytes | |||
| ) | ((((xlrp) - 1) / (wal_segsz_bytes)) == (logSegNo)) |
Definition at line 137 of file xlog_internal.h.
| #define XLByteInSeg | ( | xlrp, | |
| logSegNo, | |||
| wal_segsz_bytes | |||
| ) | (((xlrp) / (wal_segsz_bytes)) == (logSegNo)) |
Definition at line 134 of file xlog_internal.h.
| #define XLByteToPrevSeg | ( | xlrp, | |
| logSegNo, | |||
| wal_segsz_bytes | |||
| ) | logSegNo = ((xlrp) - 1) / (wal_segsz_bytes) |
Definition at line 118 of file xlog_internal.h.
| #define XLByteToSeg | ( | xlrp, | |
| logSegNo, | |||
| wal_segsz_bytes | |||
| ) | logSegNo = (xlrp) / (wal_segsz_bytes) |
Definition at line 115 of file xlog_internal.h.
| #define XLOG_CONTROL_FILE "global/pg_control" |
Definition at line 148 of file xlog_internal.h.
| #define XLOG_FNAME_LEN 24 |
Definition at line 157 of file xlog_internal.h.
Definition at line 34 of file xlog_internal.h.
| #define XLOGDIR "pg_wal" |
Definition at line 147 of file xlog_internal.h.
| #define XLogMBVarToSegs | ( | mbvar, | |
| wal_segsz_bytes | |||
| ) | ((mbvar) / ((wal_segsz_bytes) / (1024 * 1024))) |
Definition at line 125 of file xlog_internal.h.
| #define XLogPageHeaderSize | ( | hdr | ) | (((hdr)->xlp_info & XLP_LONG_HEADER) ? SizeOfXLogLongPHD : SizeOfXLogShortPHD) |
Definition at line 82 of file xlog_internal.h.
| #define XLogSegmentOffset | ( | xlogptr, | |
| wal_segsz_bytes | |||
| ) | ((xlogptr) & ((wal_segsz_bytes) - 1)) |
Definition at line 104 of file xlog_internal.h.
| #define XLogSegmentsPerXLogId | ( | wal_segsz_bytes | ) | (UINT64CONST(0x100000000) / (wal_segsz_bytes)) |
Definition at line 98 of file xlog_internal.h.
| #define XLogSegNoOffsetToRecPtr | ( | segno, | |
| offset, | |||
| wal_segsz_bytes, | |||
| dest | |||
| ) | (dest) = (segno) * (wal_segsz_bytes) + (offset) |
Definition at line 101 of file xlog_internal.h.
| #define XLP_ALL_FLAGS 0x0007 |
Definition at line 80 of file xlog_internal.h.
| #define XLP_FIRST_IS_CONTRECORD 0x0001 |
Definition at line 74 of file xlog_internal.h.
| #define XLP_FIRST_IS_OVERWRITE_CONTRECORD 0x0004 |
Definition at line 78 of file xlog_internal.h.
| #define XLP_LONG_HEADER 0x0002 |
Definition at line 76 of file xlog_internal.h.
| #define XRecOffIsValid | ( | xlrp | ) | ((xlrp) % XLOG_BLCKSZ >= SizeOfXLogShortPHD) |
Definition at line 141 of file xlog_internal.h.
Definition at line 71 of file xlog_internal.h.
Definition at line 54 of file xlog_internal.h.
| typedef struct XLogRecData XLogRecData |
|
inlinestatic |
Definition at line 242 of file xlog_internal.h.
References fb(), MAXFNAMELEN, snprintf, XLogSegmentOffset, and XLogSegmentsPerXLogId.
Referenced by do_pg_backup_stop().
|
inlinestatic |
Definition at line 259 of file xlog_internal.h.
References fb(), MAXPGPATH, snprintf, XLOGDIR, XLogSegmentOffset, and XLogSegmentsPerXLogId.
Referenced by do_pg_backup_stop().
|
extern |
Definition at line 6695 of file xlog.c.
References fb(), XLogCtlData::lastSegSwitchLSN, XLogCtlData::lastSegSwitchTime, LW_SHARED, LWLockAcquire(), LWLockRelease(), and XLogCtl.
Referenced by CheckArchiveTimeout().
|
extern |
Definition at line 9614 of file xlog.c.
References ControlFileData::checkPointCopy, ControlFile, fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), CheckPoint::redo, and CheckPoint::ThisTimeLineID.
Referenced by ExecuteRecoveryCommand(), and RestoreArchivedFile().
Definition at line 364 of file xlog_internal.h.
References RmgrIdExists(), RmgrNotFound(), RmgrTable, and unlikely.
Referenced by ApplyWalRecord(), check_wal_consistency_checking(), GetWALBlockInfo(), GetWALRecordInfo(), GetXLogSummaryStats(), LogicalDecodingProcessRecord(), pg_get_wal_resource_managers(), verifyBackupPageConsistency(), and xlog_outdesc().
Definition at line 251 of file xlog_internal.h.
References fb(), and XLOG_FNAME_LEN.
Referenced by CleanupBackupHistory(), CleanupPriorWALFiles(), and SetWALFileNameForCleanup().
Definition at line 190 of file xlog_internal.h.
References fb(), and XLOG_FNAME_LEN.
Referenced by CleanupPriorWALFiles(), FindEndOfXLOG(), KillExistingXLOG(), RemoveOldXlogFiles(), and SetWALFileNameForCleanup().
Definition at line 222 of file xlog_internal.h.
References fb().
Referenced by perform_base_backup(), ready_file_comparator(), and XLogArchiveNotify().
Definition at line 178 of file xlog_internal.h.
References fb(), and XLOG_FNAME_LEN.
Referenced by CleanupPriorWALFiles(), FindEndOfXLOG(), getFileContentType(), KillExistingXLOG(), perform_base_backup(), pg_split_walfile_name(), RemoveNonParentXlogFiles(), RemoveOldXlogFiles(), search_directory(), SetWALFileNameForCleanup(), and XLogGetOldestSegno().
Definition at line 107 of file rmgr.c.
References ereport, errdetail(), errhint(), errmsg, ERROR, fb(), LOG, pg_strcasecmp(), process_shared_preload_libraries_in_progress, RM_MAX_CUSTOM_ID, RM_MAX_ID, RM_MIN_CUSTOM_ID, RmgrData::rm_name, RmgrIdExists(), RmgrIdIsCustom(), and RmgrTable.
Referenced by _PG_init().
|
extern |
Definition at line 8189 of file xlog.c.
References fb(), XLOG_MARK_UNIMPORTANT, XLOG_SWITCH, XLogBeginInsert(), XLogInsert(), and XLogSetRecordFlags().
Referenced by CheckArchiveTimeout(), do_pg_backup_start(), do_pg_backup_stop(), pg_switch_wal(), and ShutdownXLOG().
Definition at line 74 of file rmgr.c.
References fb(), RmgrData::rm_cleanup, RM_MAX_ID, RmgrIdExists(), and RmgrTable.
Referenced by PerformWalRecovery().
Definition at line 358 of file xlog_internal.h.
References fb(), RmgrData::rm_name, and RmgrTable.
Referenced by check_wal_consistency_checking(), GetRmgr(), GetXLogSummaryStats(), pg_get_wal_resource_managers(), RegisterCustomRmgr(), RmgrCleanup(), and RmgrStartup().
Definition at line 58 of file rmgr.c.
References fb(), RM_MAX_ID, RmgrData::rm_startup, RmgrIdExists(), and RmgrTable.
Referenced by PerformWalRecovery().
Definition at line 236 of file xlog_internal.h.
References MAXPGPATH, snprintf, and XLOGDIR.
Referenced by perform_base_backup(), pgarch_archiveDone(), pgarch_ArchiverCopyLoop(), pgarch_readyXlog(), XLogArchiveCheckDone(), XLogArchiveCleanup(), XLogArchiveForceDone(), XLogArchiveIsBusy(), XLogArchiveIsReady(), XLogArchiveIsReadyOrDone(), and XLogArchiveNotify().
|
inlinestatic |
Definition at line 216 of file xlog_internal.h.
References MAXFNAMELEN, and snprintf.
Referenced by existsTimeLineHistory(), existsTimeLineHistoryFile(), readTimeLineHistory(), restoreTimeLineHistoryFiles(), SendTimeLineHistory(), WalRcvFetchTimeLineHistoryFiles(), writeTimeLineHistory(), and writeTimeLineHistoryFile().
|
inlinestatic |
Definition at line 230 of file xlog_internal.h.
References MAXPGPATH, snprintf, and XLOGDIR.
Referenced by existsTimeLineHistory(), getTimelineHistory(), readTimeLineHistory(), SendTimeLineHistory(), writeTimeLineHistory(), and writeTimeLineHistoryFile().
|
inlinestatic |
Definition at line 164 of file xlog_internal.h.
References fb(), MAXFNAMELEN, snprintf, and XLogSegmentsPerXLogId.
Referenced by assign_wal_sync_method(), build_backup_content(), CheckXLogRemoved(), CleanupAfterArchiveRecovery(), createBackupLabel(), do_pg_backup_stop(), ExecuteRecoveryCommand(), findLastCheckpoint(), issue_xlog_fsync(), main(), open_walfile(), perform_base_backup(), pg_control_checkpoint(), pg_walfile_name(), pg_walfile_name_offset(), PrintNewControlValues(), ReadRecord(), RemoveNonParentXlogFiles(), RemoveOldXlogFiles(), RestoreArchivedFile(), SimpleXLogPageRead(), WALDumpOpenSegment(), WALDumpReadPage(), WALReadRaiseError(), WalReceiverMain(), WalSndSegmentOpen(), XLogArchiveNotifySeg(), XLogFileClose(), XLogFileRead(), XLogInitNewTimeline(), XLogPageRead(), XLogReaderValidatePageHeader(), XLogWalRcvClose(), XLogWalRcvWrite(), and XLogWrite().
Definition at line 172 of file xlog_internal.h.
References fb(), MAXFNAMELEN, and snprintf.
Referenced by SetWALFileNameForCleanup().
|
inlinestatic |
Definition at line 208 of file xlog_internal.h.
References fb(), MAXPGPATH, snprintf, XLOGDIR, and XLogSegmentsPerXLogId.
Referenced by CleanupAfterArchiveRecovery(), InstallXLogFileSegment(), wal_segment_open(), WalSndSegmentOpen(), WriteEmptyXLOG(), XLogFileCopy(), XLogFileInitInternal(), XLogFileOpen(), XLogFileRead(), and XLogFileReadAnyTLI().
|
inlinestatic |
Definition at line 198 of file xlog_internal.h.
References fb(), and XLogSegmentsPerXLogId.
Referenced by decide_wal_file_action(), FindEndOfXLOG(), FindStreamingStart(), main(), main(), perform_base_backup(), pg_split_walfile_name(), UpdateLastRemovedPtr(), and XLogGetOldestSegno().
|
extern |
Definition at line 242 of file xlogdesc.c.
References appendStringInfo(), appendStringInfoChar(), appendStringInfoString(), Assert, BKPIMAGE_COMPRESS_LZ4, BKPIMAGE_COMPRESS_PGLZ, BKPIMAGE_COMPRESS_ZSTD, BKPIMAGE_COMPRESSED, buf, RelFileLocator::dbOid, fb(), forkNames, MAIN_FORKNUM, RelFileLocator::relNumber, RelFileLocator::spcOid, XLogRecBlockImageApply, XLogRecGetBlock, XLogRecGetBlockTagExtended(), XLogRecHasBlockImage, and XLogRecMaxBlockId.
Referenced by GetWALRecordInfo(), and XLogDumpDisplayRecord().
|
extern |
Definition at line 140 of file xlogrecovery.c.
Referenced by CheckRequiredParameterValues(), existsTimeLineHistory(), FinishWalRecovery(), InitWalRecovery(), PerformRecoveryXLogAction(), PerformWalRecovery(), ReadRecord(), readRecoverySignalFile(), readTimeLineHistory(), recoveryApplyDelay(), recoveryStopsAfter(), recoveryStopsBefore(), RestoreArchivedFile(), ShutdownWalRecovery(), StartupXLOG(), validateRecoveryParameters(), writeTimeLineHistory(), xlog_redo(), and XLogPageRead().
|
extern |
Definition at line 141 of file xlogrecovery.c.
Referenced by CheckRecoveryConsistency(), FinishWalRecovery(), InitWalRecovery(), ReadRecord(), StartupXLOG(), WaitForWALToBecomeAvailable(), and xlog_redo().
|
extern |
Definition at line 85 of file xlogrecovery.c.
|
extern |
Definition at line 50 of file rmgr.c.
Referenced by GetRmgr(), RegisterCustomRmgr(), RmgrCleanup(), RmgrIdExists(), and RmgrStartup().
|
extern |
Definition at line 150 of file xlogrecovery.c.