|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <ctype.h>#include <math.h>#include <time.h>#include <fcntl.h>#include <sys/stat.h>#include <unistd.h>#include "access/clog.h"#include "access/commit_ts.h"#include "access/heaptoast.h"#include "access/multixact.h"#include "access/rewriteheap.h"#include "access/subtrans.h"#include "access/timeline.h"#include "access/transam.h"#include "access/twophase.h"#include "access/xact.h"#include "access/xlog_internal.h"#include "access/xlogarchive.h"#include "access/xloginsert.h"#include "access/xlogreader.h"#include "access/xlogrecovery.h"#include "access/xlogutils.h"#include "access/xlogwait.h"#include "backup/basebackup.h"#include "catalog/catversion.h"#include "catalog/pg_control.h"#include "catalog/pg_database.h"#include "common/controldata_utils.h"#include "common/file_utils.h"#include "executor/instrument.h"#include "miscadmin.h"#include "pg_trace.h"#include "pgstat.h"#include "port/atomics.h"#include "postmaster/bgwriter.h"#include "postmaster/startup.h"#include "postmaster/walsummarizer.h"#include "postmaster/walwriter.h"#include "replication/origin.h"#include "replication/slot.h"#include "replication/slotsync.h"#include "replication/snapbuild.h"#include "replication/walreceiver.h"#include "replication/walsender.h"#include "storage/bufmgr.h"#include "storage/fd.h"#include "storage/ipc.h"#include "storage/large_object.h"#include "storage/latch.h"#include "storage/predicate.h"#include "storage/proc.h"#include "storage/procarray.h"#include "storage/reinit.h"#include "storage/spin.h"#include "storage/sync.h"#include "utils/guc_hooks.h"#include "utils/guc_tables.h"#include "utils/injection_point.h"#include "utils/pgstat_internal.h"#include "utils/ps_status.h"#include "utils/relmapper.h"#include "utils/snapmgr.h"#include "utils/timeout.h"#include "utils/timestamp.h"#include "utils/varlena.h"
Go to the source code of this file.
Data Structures | |
| struct | XLogwrtRqst |
| struct | XLogwrtResult |
| struct | WALInsertLock |
| union | WALInsertLockPadded |
| struct | XLogCtlInsert |
| struct | XLogCtlData |
Macros | |
| #define | BootstrapTimeLineID 1 |
| #define | NUM_XLOGINSERT_LOCKS 8 |
| #define | INSERT_FREESPACE(endptr) (((endptr) % XLOG_BLCKSZ == 0) ? 0 : (XLOG_BLCKSZ - (endptr) % XLOG_BLCKSZ)) |
| #define | NextBufIdx(idx) (((idx) == XLogCtl->XLogCacheBlck) ? 0 : ((idx) + 1)) |
| #define | XLogRecPtrToBufIdx(recptr) (((recptr) / XLOG_BLCKSZ) % (XLogCtl->XLogCacheBlck + 1)) |
| #define | UsableBytesInPage (XLOG_BLCKSZ - SizeOfXLogShortPHD) |
| #define | ConvertToXSegs(x, segsize) XLogMBVarToSegs((x), (segsize)) |
| #define | RefreshXLogWriteResult(_target) |
Enumerations | |
| enum | WalInsertClass { WALINSERT_NORMAL , WALINSERT_SPECIAL_SWITCH , WALINSERT_SPECIAL_CHECKPOINT } |
| #define INSERT_FREESPACE | ( | endptr | ) | (((endptr) % XLOG_BLCKSZ == 0) ? 0 : (XLOG_BLCKSZ - (endptr) % XLOG_BLCKSZ)) |
| #define UsableBytesInPage (XLOG_BLCKSZ - SizeOfXLogShortPHD) |
| #define XLogRecPtrToBufIdx | ( | recptr | ) | (((recptr) / XLOG_BLCKSZ) % (XLogCtl->XLogCacheBlck + 1)) |
| Enumerator | |
|---|---|
| WALINSERT_NORMAL | |
| WALINSERT_SPECIAL_SWITCH | |
| WALINSERT_SPECIAL_CHECKPOINT | |
|
static |
Definition at line 1991 of file xlog.c.
References Assert, ControlFile, DEBUG1, elog, fb(), XLogCtlData::info_lck, XLogCtlData::InitializedUpTo, XLogCtlData::Insert, Insert(), InvalidXLogRecPtr, LogwrtResult, XLogCtlData::LogwrtRqst, LSN_FORMAT_ARGS, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MemSet, XLogCtlData::pages, pg_atomic_read_u64(), pg_atomic_write_u64(), pg_attribute_unused, pg_write_barrier, pgstat_report_fixed, pgWalUsage, RefreshXLogWriteResult, SpinLockAcquire, SpinLockRelease, ControlFileData::system_identifier, WaitXLogInsertionsToFinish(), WalUsage::wal_buffers_full, wal_segment_size, XLogwrtRqst::Write, XLogwrtResult::Write, XLogCtlData::xlblocks, XLOG_PAGE_MAGIC, XLogCtl, XLogRecPtrToBufIdx, XLogSegmentOffset, XLogWrite(), XLP_BKP_REMOVABLE, XLP_LONG_HEADER, and XLogLongPageHeaderData::xlp_sysid.
Referenced by GetXLogBuffer(), and XLogBackgroundFlush().
Definition at line 2210 of file xlog.c.
References CalculateCheckpointSegments(), CheckPointCompletionTarget, and newval.
Definition at line 2203 of file xlog.c.
References CalculateCheckpointSegments(), max_wal_size_mb, and newval.
Definition at line 4831 of file xlog.c.
References wal_consistency_checking.
Definition at line 8816 of file xlog.c.
References ereport, errcode_for_file_access(), errmsg(), fb(), get_sync_bit(), MAXFNAMELEN, openLogFile, openLogSegNo, openLogTLI, PANIC, pg_fsync(), pgstat_report_wait_end(), pgstat_report_wait_start(), wal_segment_size, wal_sync_method, XLogFileClose(), and XLogFileName().
Definition at line 5126 of file xlog.c.
References AdvanceOldestClogXid(), Assert, BootStrapCLOG(), BootStrapCommitTs(), BootStrapMultiXact(), BootStrapSUBTRANS(), BootstrapTimeLineID, ControlFileData::checkPoint, ControlFileData::checkPointCopy, close, COMP_CRC32C, ControlFile, crc, ereport, errcode_for_file_access(), errmsg(), fb(), FIN_CRC32C, FirstGenbkiObjectId, FirstMultiXactId, FirstNormalTransactionId, fullPageWrites, CheckPoint::fullPageWrites, FullTransactionIdFromEpochAndXid(), gettimeofday(), INIT_CRC32C, InitControlFile(), InvalidTransactionId, InvalidXLogRecPtr, CheckPoint::logicalDecodingEnabled, MultiXactSetNextMXact(), CheckPoint::newestCommitTsXid, CheckPoint::nextMulti, CheckPoint::nextMultiOffset, TransamVariablesData::nextOid, CheckPoint::nextOid, TransamVariablesData::nextXid, CheckPoint::nextXid, TransamVariablesData::oidCount, CheckPoint::oldestActiveXid, CheckPoint::oldestCommitTsXid, CheckPoint::oldestMulti, CheckPoint::oldestMultiDB, CheckPoint::oldestXid, CheckPoint::oldestXidDB, openLogFile, openLogTLI, PANIC, pg_fsync(), pgstat_report_wait_end(), pgstat_report_wait_start(), CheckPoint::PrevTimeLineID, ReadControlFile(), CheckPoint::redo, SetCommitTsLimit(), SetInstallXLogFileSegmentActive(), SetMultiXactIdLimit(), SetTransactionIdLimit(), SizeOfXLogLongPHD, SizeOfXLogRecord, SizeOfXLogRecordDataHeaderShort, CheckPoint::ThisTimeLineID, CheckPoint::time, ControlFileData::time, TransamVariables, wal_level, CheckPoint::wal_level, WAL_LEVEL_LOGICAL, wal_segment_size, write, WriteControlFile(), XLogRecord::xl_crc, XLogRecord::xl_info, XLogRecord::xl_prev, XLogRecord::xl_rmid, XLogRecord::xl_tot_len, XLogRecord::xl_xid, XLOG_CHECKPOINT_SHUTDOWN, XLOG_PAGE_MAGIC, XLogFileInit(), XLogPageHeaderData::xlp_info, XLP_LONG_HEADER, XLogPageHeaderData::xlp_magic, XLogPageHeaderData::xlp_pageaddr, XLogPageHeaderData::xlp_tli, and XLR_BLOCK_ID_DATA_SHORT.
Referenced by BootstrapModeMain().
Definition at line 2174 of file xlog.c.
References CheckPointCompletionTarget, CheckPointSegments, ConvertToXSegs, fb(), max_wal_size_mb, and wal_segment_size.
Referenced by assign_checkpoint_completion_target(), assign_max_wal_size(), and ReadControlFile().
Definition at line 4709 of file xlog.c.
References newval, XLOGbuffers, and XLOGChooseNumBuffers().
Definition at line 4744 of file xlog.c.
References check_wal_consistency_checking_deferred, fb(), GetRmgr(), GUC_check_errdetail, guc_malloc(), lfirst, list_free(), LOG, MemSet, newval, pfree(), pg_strcasecmp(), process_shared_preload_libraries_done, pstrdup(), RmgrData::rm_mask, RM_MAX_ID, RmgrIdExists(), and SplitIdentifierString().
Definition at line 2217 of file xlog.c.
References GUC_check_errdetail, IsValidWalSegSize, and newval.
|
static |
Definition at line 7641 of file xlog.c.
References CHECKPOINT_IS_SHUTDOWN, CheckPointBuffers(), CheckPointCLOG(), CheckPointCommitTs(), CheckPointLogicalRewriteHeap(), CheckPointMultiXact(), CheckPointPredicate(), CheckPointRelationMap(), CheckPointReplicationOrigin(), CheckPointReplicationSlots(), CheckPointSnapBuild(), CheckpointStats, CheckPointSUBTRANS(), CheckPointTwoPhase(), CheckpointStatsData::ckpt_sync_end_t, CheckpointStatsData::ckpt_sync_t, CheckpointStatsData::ckpt_write_t, fb(), GetCurrentTimestamp(), and ProcessSyncRequests().
Referenced by CreateCheckPoint(), and CreateRestartPoint().
Definition at line 5473 of file xlog.c.
References ArchiveRecoveryRequested, ControlFile, EnableHotStandby, ereport, errcode(), errdetail(), errhint(), errmsg(), FATAL, fb(), max_locks_per_xact, ControlFileData::max_locks_per_xact, max_prepared_xacts, ControlFileData::max_prepared_xacts, max_wal_senders, ControlFileData::max_wal_senders, max_worker_processes, ControlFileData::max_worker_processes, MaxConnections, ControlFileData::MaxConnections, RecoveryRequiresIntParameter(), ControlFileData::wal_level, and WAL_LEVEL_MINIMAL.
Referenced by StartupXLOG(), and xlog_redo().
| void CheckXLogRemoved | ( | XLogSegNo | segno, |
| TimeLineID | tli | ||
| ) |
Definition at line 3764 of file xlog.c.
References ereport, errcode_for_file_access(), errmsg(), ERROR, fb(), filename, XLogCtlData::info_lck, XLogCtlData::lastRemovedSegNo, MAXFNAMELEN, SpinLockAcquire, SpinLockRelease, wal_segment_size, XLogCtl, and XLogFileName().
Referenced by logical_read_xlog_page(), perform_base_backup(), and XLogSendPhysical().
|
static |
Definition at line 5377 of file xlog.c.
References durable_rename(), ERROR, ExecuteRecoveryCommand(), fb(), MAXFNAMELEN, MAXPGPATH, recoveryEndCommand, RemoveNonParentXlogFiles(), snprintf, summarize_wal, WaitForWalSummarization(), wal_segment_size, XLByteToPrevSeg, XLogArchiveCleanup(), XLogArchiveIsReadyOrDone(), XLogArchiveNotify(), XLogArchivingActive, XLogFileName(), XLogFilePath(), and XLogSegmentOffset.
Referenced by StartupXLOG().
Definition at line 4198 of file xlog.c.
References AllocateDir(), DEBUG2, elog, fb(), FreeDir(), IsBackupHistoryFileName(), MAXPGPATH, ReadDir(), snprintf, XLogArchiveCheckDone(), XLogArchiveCleanup(), and XLOGDIR.
Referenced by do_pg_backup_stop().
|
static |
Definition at line 1231 of file xlog.c.
References Assert, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errmsg_internal(), fb(), GetXLogBuffer(), INSERT_FREESPACE, MAXALIGN64, MemSet, PANIC, SizeOfXLogLongPHD, SizeOfXLogRecord, SizeOfXLogShortPHD, wal_segment_size, XLogSegmentOffset, and XLP_FIRST_IS_CONTRECORD.
Referenced by XLogInsertRecord().
Definition at line 7015 of file xlog.c.
References AbsorbSyncRequests(), ControlFileData::checkPoint, CHECKPOINT_END_OF_RECOVERY, CHECKPOINT_FORCE, CHECKPOINT_IS_SHUTDOWN, ControlFileData::checkPointCopy, CheckPointGuts(), CheckpointStats, CheckpointStatsData::ckpt_bufs_written, CheckpointStatsData::ckpt_segs_added, CheckpointStatsData::ckpt_segs_recycled, CheckpointStatsData::ckpt_segs_removed, CheckpointStatsData::ckpt_start_t, ControlFile, DB_SHUTDOWNED, DB_SHUTDOWNING, DEBUG1, DELAY_CHKPT_COMPLETE, DELAY_CHKPT_START, elog, END_CRIT_SECTION, ereport, errmsg(), errmsg_internal(), ERROR, fb(), CheckPoint::fullPageWrites, GetCurrentTimestamp(), GetLastImportantRecPtr(), GetOldestActiveTransactionId(), GetOldestTransactionIdConsideredRunning(), GetVirtualXIDsDelayingChkpt(), HaveVirtualXIDsDelayingChkpt(), XLogCtlData::info_lck, INJECTION_POINT, INJECTION_POINT_CACHED, INJECTION_POINT_LOAD, XLogCtlData::Insert, Insert(), INSERT_FREESPACE, XLogCtlData::InsertTimeLineID, InvalidateObsoleteReplicationSlots(), InvalidOid, InvalidTransactionId, InvalidXLogRecPtr, IsLogicalDecodingEnabled(), KeepLogSeg(), LocalSetXLogInsertAllowed(), LocalXLogInsertAllowed, log_checkpoints, LogCheckpointEnd(), LogCheckpointStart(), CheckPoint::logicalDecodingEnabled, LogStandbySnapshot(), LW_EXCLUSIVE, LW_SHARED, LWLockAcquire(), LWLockRelease(), MemSet, ControlFileData::minRecoveryPoint, ControlFileData::minRecoveryPointTLI, MultiXactGetCheckptMulti(), NBuffers, TransamVariablesData::newestCommitTsXid, CheckPoint::newestCommitTsXid, CheckPoint::nextMulti, CheckPoint::nextMultiOffset, TransamVariablesData::nextOid, CheckPoint::nextOid, TransamVariablesData::nextXid, CheckPoint::nextXid, TransamVariablesData::oidCount, CheckPoint::oldestActiveXid, TransamVariablesData::oldestCommitTsXid, CheckPoint::oldestCommitTsXid, CheckPoint::oldestMulti, CheckPoint::oldestMultiDB, TransamVariablesData::oldestXid, CheckPoint::oldestXid, TransamVariablesData::oldestXidDB, CheckPoint::oldestXidDB, PANIC, pfree(), pg_atomic_read_membarrier_u64(), pg_usleep(), pgstat_report_wait_end(), pgstat_report_wait_start(), PreallocXlogFiles(), XLogCtlData::PrevTimeLineID, CheckPoint::PrevTimeLineID, ProcLastRecPtr, RecoveryInProgress(), CheckPoint::redo, RedoRecPtr, XLogCtlInsert::RedoRecPtr, XLogCtlData::RedoRecPtr, RemoveOldXlogFiles(), RS_INVAL_IDLE_TIMEOUT, RS_INVAL_WAL_REMOVED, SizeOfXLogLongPHD, SizeOfXLogShortPHD, SpinLockAcquire, SpinLockRelease, START_CRIT_SECTION, ControlFileData::state, SyncPostCheckpoint(), SyncPreCheckpoint(), CheckPoint::ThisTimeLineID, CheckPoint::time, TransamVariables, TruncateSUBTRANS(), XLogCtlData::unloggedLSN, ControlFileData::unloggedLSN, update_checkpoint_display(), UpdateCheckPointDistanceEstimate(), UpdateControlFile(), WakeupWalSummarizer(), wal_level, CheckPoint::wal_level, wal_segment_size, WALInsertLockAcquireExclusive(), WALInsertLockRelease(), XLByteToSeg, XLOG_CHECKPOINT_ONLINE, XLOG_CHECKPOINT_REDO, XLOG_CHECKPOINT_SHUTDOWN, XLogBeginInsert(), XLogBytePosToRecPtr(), XLogCtl, XLogFlush(), XLogInsert(), XLogRecPtrIsValid, XLogRegisterData(), XLogSegmentOffset, and XLogStandbyInfoActive.
Referenced by CheckpointerMain(), RequestCheckpoint(), and ShutdownXLOG().
Definition at line 7506 of file xlog.c.
References ControlFile, elog, END_CRIT_SECTION, ERROR, fb(), GetCurrentTimestamp(), XLogCtlData::InsertTimeLineID, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), ControlFileData::minRecoveryPoint, ControlFileData::minRecoveryPointTLI, XLogCtlData::PrevTimeLineID, RecoveryInProgress(), START_CRIT_SECTION, UpdateControlFile(), wal_level, WALInsertLockAcquireExclusive(), WALInsertLockRelease(), XLOG_END_OF_RECOVERY, XLogBeginInsert(), XLogCtl, XLogFlush(), XLogInsert(), and XLogRegisterData().
Referenced by PerformRecoveryXLogAction().
|
static |
Definition at line 7571 of file xlog.c.
References elog, END_CRIT_SECTION, ERROR, fb(), GetCurrentTimestamp(), GetXLogBuffer(), GetXLogInsertRecPtr(), LSN_FORMAT_ARGS, ProcLastRecPtr, RecoveryInProgress(), SizeOfXLogLongPHD, SizeOfXLogShortPHD, START_CRIT_SECTION, wal_segment_size, WALInsertLockAcquire(), WALInsertLockRelease(), XLOG_OVERWRITE_CONTRECORD, XLogBeginInsert(), XLogFlush(), XLogInsert(), XLogRegisterData(), XLogSegmentOffset, and XLP_FIRST_IS_OVERWRITE_CONTRECORD.
Referenced by StartupXLOG().
Definition at line 7721 of file xlog.c.
References archiveCleanupCommand, Assert, B_CHECKPOINTER, ControlFileData::checkPoint, CHECKPOINT_IS_SHUTDOWN, ControlFileData::checkPointCopy, CheckPointGuts(), CheckpointStats, CheckpointStatsData::ckpt_start_t, ControlFile, DB_IN_ARCHIVE_RECOVERY, DB_SHUTDOWNED_IN_RECOVERY, DEBUG2, EnableHotStandby, ereport, errdetail(), errmsg(), errmsg_internal(), ExecuteRecoveryCommand(), fb(), GetCurrentTimestamp(), GetLatestXTime(), GetOldestTransactionIdConsideredRunning(), GetWalRcvFlushRecPtr(), GetXLogReplayRecPtr(), XLogCtlData::info_lck, INJECTION_POINT, XLogCtlData::Insert, XLogCtlData::InsertTimeLineID, InvalidateObsoleteReplicationSlots(), InvalidOid, InvalidTransactionId, InvalidXLogRecPtr, IsUnderPostmaster, KeepLogSeg(), XLogCtlData::lastCheckPoint, XLogCtlData::lastCheckPointEndPtr, XLogCtlData::lastCheckPointRecPtr, LocalMinRecoveryPoint, LocalMinRecoveryPointTLI, LOG, log_checkpoints, LogCheckpointEnd(), LogCheckpointStart(), LSN_FORMAT_ARGS, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MemSet, ControlFileData::minRecoveryPoint, ControlFileData::minRecoveryPointTLI, MyBackendType, PreallocXlogFiles(), RecoveryInProgress(), CheckPoint::redo, RedoRecPtr, XLogCtlInsert::RedoRecPtr, XLogCtlData::RedoRecPtr, RemoveOldXlogFiles(), RS_INVAL_IDLE_TIMEOUT, RS_INVAL_WAL_REMOVED, SpinLockAcquire, SpinLockRelease, ControlFileData::state, CheckPoint::ThisTimeLineID, timestamptz_to_str(), TruncateSUBTRANS(), update_checkpoint_display(), UpdateCheckPointDistanceEstimate(), UpdateControlFile(), UpdateMinRecoveryPoint(), wal_segment_size, WALInsertLockAcquireExclusive(), WALInsertLockRelease(), XLByteToSeg, XLogCtl, and XLogRecPtrIsValid.
Referenced by CheckpointerMain(), and ShutdownXLOG().
Definition at line 4647 of file xlog.c.
References Assert, ControlFile, ControlFileData::data_checksum_version, and fb().
Referenced by PageIsVerified(), PageSetChecksumCopy(), PageSetChecksumInplace(), pg_stat_get_db_checksum_failures(), pg_stat_get_db_checksum_last_failure(), ReadControlFile(), and sendFile().
Definition at line 9557 of file xlog.c.
References arg, Assert, DatumGetBool(), ereport, errmsg(), fb(), XLogCtlData::Insert, XLogCtlInsert::runningBackups, SESSION_BACKUP_NONE, sessionBackupState, WALInsertLockAcquireExclusive(), WALInsertLockRelease(), WARNING, and XLogCtl.
Referenced by do_pg_backup_start(), perform_base_backup(), and register_persistent_abort_backup_handler().
| void do_pg_backup_start | ( | const char * | backupidstr, |
| bool | fast, | ||
| List ** | tablespaces, | ||
| BackupState * | state, | ||
| StringInfo | tblspcmapfile | ||
| ) |
Definition at line 8955 of file xlog.c.
References AllocateDir(), appendStringInfo(), appendStringInfoChar(), Assert, backup_started_in_recovery, BoolGetDatum(), ControlFileData::checkPoint, CHECKPOINT_FAST, CHECKPOINT_FORCE, CHECKPOINT_WAIT, ControlFileData::checkPointCopy, ControlFile, DataDir, do_pg_abort_backup(), ereport, errcode(), errhint(), errmsg(), ERROR, fb(), FreeDir(), CheckPoint::fullPageWrites, get_dirent_type(), XLogCtlData::info_lck, initStringInfo(), XLogCtlData::Insert, IS_DIR_SEP, lappend(), XLogCtlInsert::lastBackupStart, XLogCtlData::lastFpwDisableRecPtr, LW_SHARED, LWLockAcquire(), LWLockRelease(), MAXPGPATH, palloc_object, pfree(), PG_END_ENSURE_ERROR_CLEANUP, PG_ENSURE_ERROR_CLEANUP, PG_TBLSPC_DIR, PGFILETYPE_DIR, PGFILETYPE_LNK, pstrdup(), ReadDir(), readlink, RecoveryInProgress(), CheckPoint::redo, relpath, RequestCheckpoint(), RequestXLogSwitch(), XLogCtlInsert::runningBackups, SESSION_BACKUP_RUNNING, sessionBackupState, snprintf, SpinLockAcquire, SpinLockRelease, strlcpy(), CheckPoint::ThisTimeLineID, WALInsertLockAcquireExclusive(), WALInsertLockRelease(), WARNING, XLogCtl, and XLogIsNeeded.
Referenced by perform_base_backup(), and pg_backup_start().
| void do_pg_backup_stop | ( | BackupState * | state, |
| bool | waitforarchive | ||
| ) |
Definition at line 9283 of file xlog.c.
References AllocateFile(), Assert, BackupHistoryFileName(), BackupHistoryFilePath(), build_backup_content(), CHECK_FOR_INTERRUPTS, CleanupBackupHistory(), ControlFile, ereport, errcode(), errcode_for_file_access(), errhint(), errmsg(), ERROR, fb(), fprintf, FreeFile(), XLogCtlData::info_lck, XLogCtlData::Insert, XLogCtlData::InsertTimeLineID, XLogCtlData::lastFpwDisableRecPtr, LW_SHARED, LWLockAcquire(), LWLockRelease(), MAXFNAMELEN, MAXPGPATH, ControlFileData::minRecoveryPoint, ControlFileData::minRecoveryPointTLI, MyLatch, NOTICE, pfree(), RecoveryInProgress(), RequestXLogSwitch(), ResetLatch(), XLogCtlInsert::runningBackups, SESSION_BACKUP_NONE, sessionBackupState, SpinLockAcquire, SpinLockRelease, WaitLatch(), wal_segment_size, WALInsertLockAcquireExclusive(), WALInsertLockRelease(), WARNING, WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, WL_TIMEOUT, XLByteToPrevSeg, XLByteToSeg, XLOG_BACKUP_END, XLogArchiveIsBusy(), XLogArchivingActive, XLogArchivingAlways, XLogBeginInsert(), XLogCtl, XLogFileName(), XLogInsert(), XLogIsNeeded, and XLogRegisterData().
Referenced by perform_base_backup(), and pg_backup_stop().
| SessionBackupState get_backup_status | ( | void | ) |
Definition at line 9264 of file xlog.c.
References sessionBackupState.
Referenced by pg_backup_start(), pg_backup_stop(), and SendBaseBackup().
Definition at line 8768 of file xlog.c.
References AmWalReceiverProcess, elog, enableFsync, ERROR, fb(), io_direct_flags, IO_DIRECT_WAL, O_DSYNC, PG_O_DIRECT, WAL_SYNC_METHOD_FDATASYNC, WAL_SYNC_METHOD_FSYNC, WAL_SYNC_METHOD_FSYNC_WRITETHROUGH, WAL_SYNC_METHOD_OPEN, and WAL_SYNC_METHOD_OPEN_DSYNC.
Referenced by assign_wal_sync_method(), XLogFileInit(), XLogFileInitInternal(), and XLogFileOpen().
Definition at line 4952 of file xlog.c.
References ControlFile, and ControlFileData::wal_level.
Definition at line 4661 of file xlog.c.
References ControlFile, and ControlFileData::default_char_signedness.
Referenced by CMPTRGM_CHOOSE().
| XLogRecPtr GetFakeLSNForUnloggedRel | ( | void | ) |
Definition at line 4676 of file xlog.c.
References pg_atomic_fetch_add_u64(), XLogCtlData::unloggedLSN, and XLogCtl.
Referenced by gistGetFakeLSN().
| XLogRecPtr GetFlushRecPtr | ( | TimeLineID * | insertTLI | ) |
Definition at line 6625 of file xlog.c.
References Assert, fb(), XLogwrtResult::Flush, XLogCtlData::InsertTimeLineID, LogwrtResult, RECOVERY_STATE_DONE, RefreshXLogWriteResult, XLogCtlData::SharedRecoveryState, and XLogCtl.
Referenced by binary_upgrade_check_logical_slot_pending_wal(), get_flush_position(), GetCurrentLSN(), GetCurrentLSNForWaitType(), GetLatestLSN(), IdentifySystem(), pg_current_wal_flush_lsn(), pg_logical_slot_get_changes_guts(), pg_replication_slot_advance(), read_local_xlog_page_guts(), StartReplication(), WalSndWaitForWal(), XLogSendLogical(), and XLogSendPhysical().
| void GetFullPageWriteInfo | ( | XLogRecPtr * | RedoRecPtr_p, |
| bool * | doPageWrites_p | ||
| ) |
Definition at line 6593 of file xlog.c.
References doPageWrites, fb(), and RedoRecPtr.
Referenced by XLogCheckBufferNeedsBackup(), and XLogInsert().
| XLogRecPtr GetInsertRecPtr | ( | void | ) |
Definition at line 6608 of file xlog.c.
References fb(), XLogCtlData::info_lck, XLogCtlData::LogwrtRqst, SpinLockAcquire, SpinLockRelease, XLogwrtRqst::Write, and XLogCtl.
Referenced by CheckpointerMain(), gistvacuumscan(), IsCheckpointOnSchedule(), and LogStandbySnapshot().
| XLogRecPtr GetLastImportantRecPtr | ( | void | ) |
Definition at line 6682 of file xlog.c.
References fb(), i, InvalidXLogRecPtr, WALInsertLockPadded::l, WALInsertLock::lastImportantAt, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), NUM_XLOGINSERT_LOCKS, and WALInsertLocks.
Referenced by BackgroundWriterMain(), CheckArchiveTimeout(), and CreateCheckPoint().
| pg_time_t GetLastSegSwitchData | ( | XLogRecPtr * | lastSwitchLSN | ) |
Definition at line 6711 of file xlog.c.
References fb(), XLogCtlData::lastSegSwitchLSN, XLogCtlData::lastSegSwitchTime, LW_SHARED, LWLockAcquire(), LWLockRelease(), and XLogCtl.
Referenced by CheckArchiveTimeout().
Definition at line 4637 of file xlog.c.
References Assert, ControlFile, fb(), and ControlFileData::mock_authentication_nonce.
Referenced by scram_mock_salt().
| void GetOldestRestartPoint | ( | XLogRecPtr * | oldrecptr, |
| TimeLineID * | oldtli | ||
| ) |
Definition at line 9626 of file xlog.c.
References ControlFileData::checkPointCopy, ControlFile, fb(), LW_SHARED, LWLockAcquire(), LWLockRelease(), CheckPoint::redo, and CheckPoint::ThisTimeLineID.
Referenced by ExecuteRecoveryCommand(), and RestoreArchivedFile().
| RecoveryState GetRecoveryState | ( | void | ) |
Definition at line 6496 of file xlog.c.
References XLogCtlData::info_lck, XLogCtlData::SharedRecoveryState, SpinLockAcquire, SpinLockRelease, and XLogCtl.
Referenced by XLogArchiveCheckDone().
| XLogRecPtr GetRedoRecPtr | ( | void | ) |
Definition at line 6563 of file xlog.c.
References XLogCtlData::info_lck, RedoRecPtr, XLogCtlData::RedoRecPtr, SpinLockAcquire, SpinLockRelease, and XLogCtl.
Referenced by CheckPointLogicalRewriteHeap(), CheckPointSnapBuild(), MaybeRemoveOldWalSummaries(), nextval_internal(), ReplicationSlotReserveWal(), reserve_wal_for_local_slot(), smgr_bulk_finish(), smgr_bulk_start_smgr(), XLogPageRead(), XLogSaveBufferForHint(), and XLogWrite().
Definition at line 4627 of file xlog.c.
References Assert, ControlFile, fb(), and ControlFileData::system_identifier.
Referenced by IdentifySystem(), InitializeBackupManifest(), LogicalRepSyncSequences(), manifest_process_system_identifier(), ReplicationSlotNameForTablesync(), and WalReceiverMain().
| WALAvailability GetWALAvailability | ( | XLogRecPtr | targetLSN | ) |
Definition at line 8002 of file xlog.c.
References ConvertToXSegs, fb(), GetXLogWriteRecPtr(), KeepLogSeg(), max_wal_size_mb, wal_segment_size, WALAVAIL_EXTENDED, WALAVAIL_INVALID_LSN, WALAVAIL_REMOVED, WALAVAIL_RESERVED, WALAVAIL_UNRESERVED, XLByteToSeg, XLogGetLastRemovedSegno(), and XLogRecPtrIsValid.
Referenced by pg_get_replication_slots().
| TimeLineID GetWALInsertionTimeLine | ( | void | ) |
Definition at line 6646 of file xlog.c.
References Assert, XLogCtlData::InsertTimeLineID, RECOVERY_STATE_DONE, XLogCtlData::SharedRecoveryState, and XLogCtl.
Referenced by logical_read_xlog_page(), pg_walfile_name(), pg_walfile_name_offset(), ReadReplicationSlot(), WALReadFromBuffers(), and XLogSendPhysical().
| TimeLineID GetWALInsertionTimeLineIfSet | ( | void | ) |
Definition at line 6662 of file xlog.c.
References fb(), XLogCtlData::info_lck, XLogCtlData::InsertTimeLineID, SpinLockAcquire, SpinLockRelease, and XLogCtl.
Referenced by GetLatestLSN().
|
static |
Definition at line 1638 of file xlog.c.
References AdvanceXLInsertBuffer(), Assert, elog, fb(), idx(), LSN_FORMAT_ARGS, XLogCtlData::pages, PANIC, pg_atomic_read_u64(), pg_memory_barrier, SizeOfXLogLongPHD, SizeOfXLogShortPHD, wal_segment_size, WALInsertLockUpdateInsertingAt(), XLogCtlData::xlblocks, XLOG_PAGE_MAGIC, XLogCtl, XLogRecPtrToBufIdx, and XLogSegmentOffset.
Referenced by CopyXLogRecordToWAL(), and CreateOverwriteContrecordRecord().
| XLogRecPtr GetXLogInsertRecPtr | ( | void | ) |
Definition at line 9598 of file xlog.c.
References fb(), XLogCtlData::Insert, Insert(), SpinLockAcquire, SpinLockRelease, XLogBytePosToRecPtr(), and XLogCtl.
Referenced by CreateOverwriteContrecordRecord(), gistGetFakeLSN(), logical_begin_heap_rewrite(), pg_current_wal_insert_lsn(), and ReplicationSlotReserveWal().
| XLogRecPtr GetXLogWriteRecPtr | ( | void | ) |
Definition at line 9614 of file xlog.c.
References LogwrtResult, RefreshXLogWriteResult, and XLogwrtResult::Write.
Referenced by FinishSyncWorker(), GetWALAvailability(), pg_current_wal_lsn(), pg_get_replication_slots(), and ProcessStandbyPSRequestMessage().
Definition at line 4241 of file xlog.c.
References ControlFile, ControlFileData::data_checksum_version, DB_SHUTDOWNED, ereport, errcode(), errmsg(), fb(), FirstNormalUnloggedLSN, max_locks_per_xact, ControlFileData::max_locks_per_xact, max_prepared_xacts, ControlFileData::max_prepared_xacts, max_wal_senders, ControlFileData::max_wal_senders, max_worker_processes, ControlFileData::max_worker_processes, MaxConnections, ControlFileData::MaxConnections, MOCK_AUTH_NONCE_LEN, ControlFileData::mock_authentication_nonce, PANIC, pg_strong_random(), ControlFileData::state, ControlFileData::system_identifier, track_commit_timestamp, ControlFileData::track_commit_timestamp, ControlFileData::unloggedLSN, wal_level, ControlFileData::wal_level, wal_log_hints, and ControlFileData::wal_log_hints.
Referenced by BootStrapXLOG().
Definition at line 4858 of file xlog.c.
References Assert, check_wal_consistency_checking_deferred, ERROR, fb(), find_option(), GUC_ACTION_SET, process_shared_preload_libraries_done, set_config_option_ext(), and wal_consistency_checking_string.
Referenced by PostgresSingleUserMain(), and PostmasterMain().
|
static |
Definition at line 3600 of file xlog.c.
References Assert, DEBUG1, durable_rename(), durable_unlink(), fb(), XLogCtlData::InstallXLogFileSegmentActive, LOG, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), MAXPGPATH, stat, wal_segment_size, XLogCtl, and XLogFilePath().
Referenced by RemoveXlogFile(), XLogFileCopy(), and XLogFileInitInternal().
Definition at line 9663 of file xlog.c.
References fb(), XLogCtlData::InstallXLogFileSegmentActive, LW_SHARED, LWLockAcquire(), LWLockRelease(), and XLogCtl.
Referenced by XLogFileRead().
| void issue_xlog_fsync | ( | int | fd, |
| XLogSegNo | segno, | ||
| TimeLineID | tli | ||
| ) |
Definition at line 8858 of file xlog.c.
References _, Assert, enableFsync, ereport, errcode(), errcode_for_file_access(), errmsg(), errmsg_internal(), fb(), fd(), IOCONTEXT_NORMAL, IOOBJECT_WAL, IOOP_FSYNC, MAXFNAMELEN, PANIC, pg_fdatasync(), pg_fsync_no_writethrough(), pg_fsync_writethrough(), pgstat_count_io_op_time(), pgstat_prepare_io_time(), pgstat_report_wait_end(), pgstat_report_wait_start(), start, track_wal_io_timing, wal_segment_size, wal_sync_method, WAL_SYNC_METHOD_FDATASYNC, WAL_SYNC_METHOD_FSYNC, WAL_SYNC_METHOD_FSYNC_WRITETHROUGH, WAL_SYNC_METHOD_OPEN, WAL_SYNC_METHOD_OPEN_DSYNC, and XLogFileName().
Referenced by XLogWalRcvFlush(), and XLogWrite().
|
static |
Definition at line 8086 of file xlog.c.
References ConvertToXSegs, fb(), GetOldestUnsummarizedLSN(), IsBinaryUpgrade, max_slot_wal_keep_size_mb, wal_keep_size_mb, wal_segment_size, XLByteToSeg, XLogGetReplicationSlotMinimumLSN(), and XLogRecPtrIsValid.
Referenced by CreateCheckPoint(), CreateRestartPoint(), and GetWALAvailability().
Definition at line 4939 of file xlog.c.
References Assert, ControlFile, fb(), palloc_object, ReadControlFile(), and reset().
Referenced by PostgresSingleUserMain(), PostmasterMain(), and PostmasterStateMachine().
Definition at line 6548 of file xlog.c.
References fb(), and LocalXLogInsertAllowed.
Referenced by CreateCheckPoint(), and StartupXLOG().
Definition at line 6807 of file xlog.c.
References ControlFileData::checkPoint, ControlFileData::checkPointCopy, CheckPointDistanceEstimate, CheckpointStats, CheckpointStatsData::ckpt_agg_sync_time, CheckpointStatsData::ckpt_bufs_written, CheckpointStatsData::ckpt_end_t, CheckpointStatsData::ckpt_longest_sync, CheckpointStatsData::ckpt_segs_added, CheckpointStatsData::ckpt_segs_recycled, CheckpointStatsData::ckpt_segs_removed, CheckpointStatsData::ckpt_slru_written, CheckpointStatsData::ckpt_start_t, CheckpointStatsData::ckpt_sync_end_t, CheckpointStatsData::ckpt_sync_rels, CheckpointStatsData::ckpt_sync_t, CheckpointStatsData::ckpt_write_t, ControlFile, ereport, errmsg(), fb(), GetCurrentTimestamp(), LOG, log_checkpoints, LSN_FORMAT_ARGS, NBuffers, PendingCheckpointerStats, PrevCheckPointDistance, CheckPoint::redo, PgStat_CheckpointerStats::sync_time, TimestampDifferenceMilliseconds(), and PgStat_CheckpointerStats::write_time.
Referenced by CreateCheckPoint(), and CreateRestartPoint().
Definition at line 6775 of file xlog.c.
References CHECKPOINT_CAUSE_TIME, CHECKPOINT_CAUSE_XLOG, CHECKPOINT_END_OF_RECOVERY, CHECKPOINT_FAST, CHECKPOINT_FLUSH_UNLOGGED, CHECKPOINT_FORCE, CHECKPOINT_IS_SHUTDOWN, CHECKPOINT_WAIT, ereport, errmsg(), fb(), and LOG.
Referenced by CreateCheckPoint(), and CreateRestartPoint().
Definition at line 6410 of file xlog.c.
References ArchiveRecoveryRequested, CHECKPOINT_END_OF_RECOVERY, CHECKPOINT_FAST, CHECKPOINT_WAIT, CreateEndOfRecoveryRecord(), fb(), IsUnderPostmaster, PromoteIsTriggered(), and RequestCheckpoint().
Referenced by StartupXLOG().
|
static |
Definition at line 3727 of file xlog.c.
References CheckpointStats, CheckpointStatsData::ckpt_segs_added, close, fb(), XLogCtlData::InstallXLogFileSegmentActive, MAXPGPATH, wal_segment_size, XLByteToPrevSeg, XLogCtl, XLogFileInitInternal(), and XLogSegmentOffset.
Referenced by CreateCheckPoint(), CreateRestartPoint(), and StartupXLOG().
| void ReachedEndOfBackup | ( | XLogRecPtr | EndRecPtr, |
| TimeLineID | tli | ||
| ) |
Definition at line 6373 of file xlog.c.
References ControlFileData::backupEndPoint, ControlFileData::backupEndRequired, ControlFileData::backupStartPoint, ControlFile, fb(), InvalidXLogRecPtr, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), ControlFileData::minRecoveryPoint, ControlFileData::minRecoveryPointTLI, and UpdateControlFile().
Referenced by CheckRecoveryConsistency().
Definition at line 4386 of file xlog.c.
References Assert, BasicOpenFile(), ControlFileData::blcksz, CalculateCheckpointSegments(), CATALOG_VERSION_NO, ControlFileData::catalog_version_no, close, COMP_CRC32C, ControlFile, ConvertToXSegs, ControlFileData::crc, crc, DataChecksumsEnabled(), EQ_CRC32C, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errcode_for_file_access(), errdetail(), errhint(), errmsg(), errmsg_plural(), ERROR, FATAL, fb(), fd(), FIN_CRC32C, ControlFileData::float8ByVal, ControlFileData::floatFormat, FLOATFORMAT_VALUE, INDEX_MAX_KEYS, ControlFileData::indexMaxKeys, INIT_CRC32C, IsValidWalSegSize, ControlFileData::loblksize, LOBLKSIZE, max_wal_size_mb, ControlFileData::maxAlign, min_wal_size_mb, ControlFileData::nameDataLen, NAMEDATALEN, PANIC, PG_BINARY, PG_CONTROL_VERSION, ControlFileData::pg_control_version, PGC_INTERNAL, PGC_S_DYNAMIC_DEFAULT, pgstat_report_wait_end(), pgstat_report_wait_start(), read, ControlFileData::relseg_size, SetConfigOption(), SizeOfXLogLongPHD, SizeOfXLogShortPHD, ControlFileData::slru_pages_per_segment, SLRU_PAGES_PER_SEGMENT, snprintf, TOAST_MAX_CHUNK_SIZE, ControlFileData::toast_max_chunk_size, UsableBytesInPage, UsableBytesInSegment, wal_segment_size, ControlFileData::xlog_blcksz, XLOG_CONTROL_FILE, and ControlFileData::xlog_seg_size.
Referenced by BootStrapXLOG(), and LocalProcessControlFile().
Definition at line 6460 of file xlog.c.
References fb(), LocalRecoveryInProgress, RECOVERY_STATE_DONE, and XLogCtl.
Referenced by amcheck_index_mainfork_expected(), attribute_statistics_update(), BackgroundWriterMain(), BeginReportingGUCOptions(), brin_desummarize_range(), brin_summarize_range(), CanInvalidateIdleSlot(), check_transaction_isolation(), check_transaction_read_only(), CheckArchiveTimeout(), CheckLogicalDecodingRequirements(), CheckpointerMain(), ComputeXidHorizons(), CreateCheckPoint(), CreateDecodingContext(), CreateEndOfRecoveryRecord(), CreateOverwriteContrecordRecord(), CreateRestartPoint(), DisableLogicalDecoding(), DisableLogicalDecodingIfNecessary(), do_pg_backup_start(), do_pg_backup_stop(), EnableLogicalDecoding(), EnsureLogicalDecodingEnabled(), error_commit_ts_disabled(), ExecCheckpoint(), ExecWaitStmt(), extended_statistics_update(), get_relation_info(), GetCurrentLSN(), GetLatestLSN(), GetNewMultiXactId(), GetNewObjectId(), GetNewTransactionId(), GetOldestActiveTransactionId(), GetOldestSafeDecodingTransactionId(), GetRunningTransactionData(), GetSerializableTransactionSnapshot(), GetSerializableTransactionSnapshotInt(), GetSnapshotData(), GetStrictOldestNonRemovableTransactionId(), gin_clean_pending_list(), GlobalVisHorizonKindForRel(), heap_force_common(), heap_page_prune_opt(), IdentifySystem(), InitTempTableNamespace(), InitWalSender(), IsCheckpointOnSchedule(), LockAcquireExtended(), logical_read_xlog_page(), MaintainLatestCompletedXid(), MarkBufferDirtyHint(), perform_base_backup(), pg_clear_attribute_stats(), pg_clear_extended_stats(), pg_create_restore_point(), pg_current_wal_flush_lsn(), pg_current_wal_insert_lsn(), pg_current_wal_lsn(), pg_get_sequence_data(), pg_get_wal_replay_pause_state(), pg_is_in_recovery(), pg_is_wal_replay_paused(), pg_log_standby_snapshot(), pg_logical_slot_get_changes_guts(), pg_promote(), pg_replication_slot_advance(), pg_sequence_last_value(), pg_switch_wal(), pg_sync_replication_slots(), pg_wal_replay_pause(), pg_wal_replay_resume(), pg_walfile_name(), pg_walfile_name_offset(), pgstat_report_replslotsync(), PhysicalWakeupLogicalWalSnd(), PrepareRedoAdd(), PrepareRedoRemoveFull(), PreventCommandDuringRecovery(), ProcessStandbyPSRequestMessage(), ProcSleep(), read_local_xlog_page_guts(), ReadReplicationSlot(), recovery_create_dbdir(), relation_statistics_update(), ReplicationSlotAlter(), ReplicationSlotCreate(), ReplicationSlotDrop(), ReplicationSlotReserveWal(), replorigin_check_prerequisites(), ReportChangedGUCOptions(), sendDir(), SerialSetActiveSerXmin(), show_effective_wal_level(), show_in_hot_standby(), ShutdownXLOG(), SnapBuildWaitSnapshot(), StandbySlotsHaveCaughtup(), StartLogicalReplication(), StartReplication(), StartTransaction(), TransactionIdIsInProgress(), TruncateMultiXact(), UpdateFullPageWrites(), UpdateLogicalDecodingStatusEndOfRecovery(), verify_heapam(), WaitForLSN(), WALReadFromBuffers(), WalReceiverMain(), WalSndWaitForWal(), XLogBackgroundFlush(), XLogFlush(), XLogInsertAllowed(), and XLogSendPhysical().
|
static |
Definition at line 7681 of file xlog.c.
References DEBUG2, elog, XLogReaderState::EndRecPtr, XLogCtlData::info_lck, XLogCtlData::lastCheckPoint, XLogCtlData::lastCheckPointEndPtr, XLogCtlData::lastCheckPointRecPtr, LSN_FORMAT_ARGS, XLogReaderState::ReadRecPtr, CheckPoint::redo, SpinLockAcquire, SpinLockRelease, XLogCtl, and XLogHaveInvalidPages().
Referenced by xlog_redo().
Definition at line 9584 of file xlog.c.
References before_shmem_exit(), BoolGetDatum(), do_pg_abort_backup(), and fb().
Referenced by pg_backup_start().
| void RemoveNonParentXlogFiles | ( | XLogRecPtr | switchpoint, |
| TimeLineID | newTLI | ||
| ) |
Definition at line 3977 of file xlog.c.
References AllocateDir(), DEBUG2, elog, fb(), FreeDir(), IsXLogFileName(), MAXFNAMELEN, ReadDir(), RemoveXlogFile(), wal_segment_size, XLByteToPrevSeg, XLByteToSeg, XLogArchiveIsReady(), XLOGDIR, and XLogFileName().
Referenced by ApplyWalRecord(), and CleanupAfterArchiveRecovery().
|
static |
Definition at line 3902 of file xlog.c.
References AllocateDir(), DEBUG2, elog, fb(), FreeDir(), IsPartialXLogFileName(), IsXLogFileName(), MAXFNAMELEN, ReadDir(), RemoveXlogFile(), UpdateLastRemovedPtr(), wal_segment_size, XLByteToSeg, XLogArchiveCheckDone(), XLOGDIR, XLogFileName(), and XLOGfileslop().
Referenced by CreateCheckPoint(), and CreateRestartPoint().
|
static |
Definition at line 4046 of file xlog.c.
References CheckpointStats, CheckpointStatsData::ckpt_segs_recycled, CheckpointStatsData::ckpt_segs_removed, DEBUG2, durable_unlink(), ereport, errcode_for_file_access(), errmsg(), errmsg_internal(), fb(), get_dirent_type(), InstallXLogFileSegment(), XLogCtlData::InstallXLogFileSegmentActive, LOG, MAXPGPATH, PGFILETYPE_REG, snprintf, wal_recycle, XLogArchiveCleanup(), XLogCtl, and XLOGDIR.
Referenced by RemoveNonParentXlogFiles(), and RemoveOldXlogFiles().
| XLogRecPtr RequestXLogSwitch | ( | bool | mark_unimportant | ) |
Definition at line 8195 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().
|
static |
Definition at line 1114 of file xlog.c.
References Assert, fb(), XLogCtlData::Insert, Insert(), MAXALIGN, SizeOfXLogRecord, SpinLockAcquire, SpinLockRelease, XLogBytePosToEndRecPtr(), XLogBytePosToRecPtr(), XLogCtl, and XLogRecPtrToBytePos().
Referenced by XLogInsertRecord().
|
static |
Definition at line 1170 of file xlog.c.
References Assert, fb(), XLogCtlData::Insert, Insert(), MAXALIGN, SizeOfXLogRecord, SpinLockAcquire, SpinLockRelease, wal_segment_size, XLogBytePosToEndRecPtr(), XLogBytePosToRecPtr(), XLogCtl, XLogRecPtrToBytePos(), and XLogSegmentOffset.
Referenced by XLogInsertRecord().
Definition at line 9655 of file xlog.c.
References fb(), XLogCtlData::InstallXLogFileSegmentActive, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), and XLogCtl.
Referenced by WaitForWALToBecomeAvailable(), and XLogShutdownWalRcv().
Definition at line 9646 of file xlog.c.
References fb(), XLogCtlData::InstallXLogFileSegmentActive, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), and XLogCtl.
Referenced by BootStrapXLOG(), StartupXLOG(), and WaitForWALToBecomeAvailable().
Definition at line 9678 of file xlog.c.
References fb(), XLogCtlData::info_lck, SpinLockAcquire, SpinLockRelease, XLogCtlData::WalWriterSleeping, and XLogCtl.
Referenced by WalWriterMain().
Definition at line 4884 of file xlog.c.
References XLogArchiveCommand, and XLogArchivingActive.
Definition at line 4911 of file xlog.c.
References IsXLogLogicalInfoEnabled(), RecoveryInProgress(), wal_level, WAL_LEVEL_MINIMAL, and XLogLogicalInfoActive.
Definition at line 4896 of file xlog.c.
References RecoveryInProgress().
Definition at line 6728 of file xlog.c.
References Assert, AuxProcessResourceOwner, CHECKPOINT_FAST, CHECKPOINT_IS_SHUTDOWN, CreateCheckPoint(), CreateRestartPoint(), CurrentResourceOwner, ereport, errmsg(), fb(), IsPostmasterEnvironment, LOG, NOTICE, RecoveryInProgress(), RequestXLogSwitch(), WalSndInitStopping(), WalSndWaitStopping(), and XLogArchivingActive.
Referenced by CheckpointerMain(), and InitPostgres().
Definition at line 5517 of file xlog.c.
References abortedRecPtr, AdvanceOldestClogXid(), ArchiveRecoveryRequested, Assert, AuxProcessResourceOwner, BACKUP_LABEL_FILE, BACKUP_LABEL_OLD, ControlFileData::backupEndRequired, ControlFileData::backupStartPoint, ControlFileData::checkPoint, CHECKPOINT_FORCE, ControlFileData::checkPointCopy, CheckRequiredParameterValues(), CleanupAfterArchiveRecovery(), CompleteCommitTsInitialization(), ControlFile, CreateOverwriteContrecordRecord(), CurrentResourceOwner, DB_IN_ARCHIVE_RECOVERY, DB_IN_CRASH_RECOVERY, DB_IN_PRODUCTION, DB_SHUTDOWNED, DB_SHUTDOWNED_IN_RECOVERY, DB_SHUTDOWNING, DEBUG1, DeleteAllExportedSnapshotFiles(), doPageWrites, durable_rename(), durable_unlink(), EnableHotStandby, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errhint(), errmsg(), errmsg_internal(), FATAL, fb(), findNewestTimeLine(), FinishWalRecovery(), FirstNormalUnloggedLSN, XLogwrtRqst::Flush, XLogwrtResult::Flush, CheckPoint::fullPageWrites, FullTransactionIdRetreat(), InArchiveRecovery, XLogCtlData::info_lck, XLogCtlData::InitializedUpTo, InitRecoveryTransactionEnvironment(), InitWalRecovery(), InRecovery, XLogCtlData::Insert, Insert(), XLogCtlData::InsertTimeLineID, InvalidXLogRecPtr, IsBootstrapProcessingMode, IsPostmasterEnvironment, lastFullPageWrites, XLogCtlData::lastSegSwitchLSN, XLogCtlData::lastSegSwitchTime, TransamVariablesData::latestCompletedXid, RunningTransactionsData::latestCompletedXid, len, LocalMinRecoveryPoint, LocalMinRecoveryPointTLI, LocalSetXLogInsertAllowed(), LOG, XLogCtlData::logFlushResult, CheckPoint::logicalDecodingEnabled, XLogCtlData::logInsertResult, XLogCtlData::logWriteResult, LogwrtResult, XLogCtlData::LogwrtRqst, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), ControlFileData::minRecoveryPoint, ControlFileData::minRecoveryPointTLI, missingContrecPtr, MultiXactSetNextMXact(), CheckPoint::newestCommitTsXid, CheckPoint::nextMulti, CheckPoint::nextMultiOffset, TransamVariablesData::nextOid, CheckPoint::nextOid, TransamVariablesData::nextXid, CheckPoint::nextXid, RunningTransactionsData::nextXid, NOTICE, TransamVariablesData::oidCount, CheckPoint::oldestActiveXid, CheckPoint::oldestCommitTsXid, CheckPoint::oldestMulti, CheckPoint::oldestMultiDB, RunningTransactionsData::oldestRunningXid, CheckPoint::oldestXid, CheckPoint::oldestXidDB, XLogCtlData::pages, PerformRecoveryXLogAction(), PerformWalRecovery(), pfree(), pg_atomic_write_membarrier_u64(), pg_atomic_write_u64(), pg_usleep(), pgstat_discard_stats(), pgstat_restore_stats(), PreallocXlogFiles(), PrescanPreparedTransactions(), XLogCtlInsert::PrevBytePos, XLogCtlData::PrevTimeLineID, ProcArrayApplyRecoveryInfo(), ProcArrayInitRecovery(), RecoverPreparedTransactions(), RECOVERY_SIGNAL_FILE, RECOVERY_STATE_ARCHIVE, RECOVERY_STATE_CRASH, RECOVERY_STATE_DONE, recoveryTargetTLI, CheckPoint::redo, RedoRecPtr, XLogCtlInsert::RedoRecPtr, XLogCtlData::RedoRecPtr, RegisterTimeout(), RelationCacheInitFileRemove(), RemoveTempXlogFiles(), RequestCheckpoint(), ResetUnloggedRelations(), restoreTimeLineHistoryFiles(), restoreTwoPhaseData(), set_ps_display(), SetCommitTsLimit(), SetInstallXLogFileSegmentActive(), SetMultiXactIdLimit(), SetTransactionIdLimit(), XLogCtlData::SharedRecoveryState, ShutdownRecoveryTransactionEnvironment(), ShutdownWalRecovery(), SpinLockAcquire, SpinLockRelease, STANDBY_DISABLED, STANDBY_SIGNAL_FILE, StandbyRecoverPreparedTransactions(), standbyState, STARTUP_PROGRESS_TIMEOUT, startup_progress_timeout_handler(), StartupCLOG(), StartupCommitTs(), StartupLogicalDecodingStatus(), StartupMultiXact(), StartupReorderBuffer(), StartupReplicationOrigin(), StartupReplicationSlots(), StartupSUBTRANS(), ControlFileData::state, str_time(), RunningTransactionsData::subxcnt, RunningTransactionsData::subxid_status, SUBXIDS_IN_SUBTRANS, SyncDataDirectory(), TABLESPACE_MAP, TABLESPACE_MAP_OLD, CheckPoint::ThisTimeLineID, CheckPoint::time, ControlFileData::time, ControlFileData::track_commit_timestamp, TransactionIdIsNormal, TransactionIdIsValid, TransactionIdRetreat, TransamVariables, TrimCLOG(), TrimMultiXact(), UNLOGGED_RELATION_CLEANUP, UNLOGGED_RELATION_INIT, XLogCtlData::unloggedLSN, ControlFileData::unloggedLSN, UpdateControlFile(), UpdateFullPageWrites(), UpdateLogicalDecodingStatusEndOfRecovery(), ValidateXLOGDirectoryStructure(), WAIT_LSN_TYPE_STANDBY_FLUSH, WAIT_LSN_TYPE_STANDBY_REPLAY, WAIT_LSN_TYPE_STANDBY_WRITE, WaitLSNWakeup(), WakeupCheckpointer(), WalSndWakeup(), XLogwrtRqst::Write, XLogwrtResult::Write, writeTimeLineHistory(), RunningTransactionsData::xcnt, XidFromFullTransactionId, RunningTransactionsData::xids, XLogCtlData::xlblocks, XLogCtl, XLogInitNewTimeline(), XLogRecPtrIsValid, XLogRecPtrToBufIdx, XLogRecPtrToBytePos(), XLogReportParameters(), and XRecOffIsValid.
Referenced by InitPostgres(), and StartupProcessMain().
Definition at line 5289 of file xlog.c.
References buf, bufsize, fb(), log_timezone, pg_localtime(), and pg_strftime().
Referenced by StartupXLOG().
| void SwitchIntoArchiveRecovery | ( | XLogRecPtr | EndRecPtr, |
| TimeLineID | replayTLI | ||
| ) |
Definition at line 6335 of file xlog.c.
References ControlFile, DB_IN_ARCHIVE_RECOVERY, fb(), XLogCtlData::info_lck, LocalMinRecoveryPoint, LocalMinRecoveryPointTLI, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), ControlFileData::minRecoveryPoint, ControlFileData::minRecoveryPointTLI, RECOVERY_STATE_ARCHIVE, XLogCtlData::SharedRecoveryState, SpinLockAcquire, SpinLockRelease, ControlFileData::state, UpdateControlFile(), updateMinRecoveryPoint, and XLogCtl.
Referenced by ReadRecord().
Definition at line 6950 of file xlog.c.
References CHECKPOINT_END_OF_RECOVERY, CHECKPOINT_IS_SHUTDOWN, fb(), reset(), set_ps_display(), and snprintf.
Referenced by CreateCheckPoint(), and CreateRestartPoint().
Definition at line 6912 of file xlog.c.
References CheckPointDistanceEstimate, fb(), and PrevCheckPointDistance.
Referenced by CreateCheckPoint(), and CreateRestartPoint().
Definition at line 4618 of file xlog.c.
References ControlFile, DataDir, and update_controlfile().
Referenced by CreateCheckPoint(), CreateEndOfRecoveryRecord(), CreateRestartPoint(), ReachedEndOfBackup(), StartupXLOG(), SwitchIntoArchiveRecovery(), UpdateMinRecoveryPoint(), xlog_redo(), and XLogReportParameters().
Definition at line 8301 of file xlog.c.
References END_CRIT_SECTION, fb(), fullPageWrites, XLogCtlData::Insert, Insert(), RecoveryInProgress(), START_CRIT_SECTION, WALInsertLockAcquireExclusive(), WALInsertLockRelease(), XLOG_FPW_CHANGE, XLogBeginInsert(), XLogCtl, XLogInsert(), XLogRegisterData(), and XLogStandbyInfoActive.
Referenced by StartupXLOG(), and UpdateSharedMemoryConfig().
Definition at line 3849 of file xlog.c.
References filename, XLogCtlData::info_lck, XLogCtlData::lastRemovedSegNo, SpinLockAcquire, SpinLockRelease, wal_segment_size, XLogCtl, and XLogFromFileName().
Referenced by RemoveOldXlogFiles().
|
static |
Definition at line 2703 of file xlog.c.
References ControlFile, DEBUG2, elog, ereport, errmsg_internal(), fb(), GetCurrentReplayRecPtr(), InRecovery, LocalMinRecoveryPoint, LocalMinRecoveryPointTLI, LSN_FORMAT_ARGS, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), ControlFileData::minRecoveryPoint, ControlFileData::minRecoveryPointTLI, UpdateControlFile(), updateMinRecoveryPoint, WARNING, and XLogRecPtrIsValid.
Referenced by CreateRestartPoint(), XLogFlush(), and XLogInitNewTimeline().
Definition at line 4136 of file xlog.c.
References ereport, errcode_for_file_access(), errmsg(), FATAL, fb(), LOG, MakePGDirectory(), MAXPGPATH, S_ISDIR, snprintf, stat, and XLOGDIR.
Referenced by StartupXLOG().
|
static |
Definition at line 1510 of file xlog.c.
References elog, ereport, errmsg(), fb(), i, XLogCtlData::Insert, Insert(), WALInsertLock::insertingAt, InvalidXLogRecPtr, WALInsertLockPadded::l, LOG, XLogCtlData::logInsertResult, LSN_FORMAT_ARGS, LWLockWaitForVar(), MyProc, NUM_XLOGINSERT_LOCKS, PANIC, pg_atomic_monotonic_advance_u64(), pg_atomic_read_membarrier_u64(), SpinLockAcquire, SpinLockRelease, WALInsertLocks, XLogBytePosToEndRecPtr(), XLogCtl, and XLogRecPtrIsValid.
Referenced by AdvanceXLInsertBuffer(), XLogBackgroundFlush(), and XLogFlush().
Definition at line 1377 of file xlog.c.
References fb(), LW_EXCLUSIVE, LWLockAcquire(), MyLockNo, MyProcNumber, NUM_XLOGINSERT_LOCKS, and WALInsertLocks.
Referenced by CreateOverwriteContrecordRecord(), and XLogInsertRecord().
Definition at line 1422 of file xlog.c.
References holdingAllLocks, i, WALInsertLock::insertingAt, WALInsertLockPadded::l, LW_EXCLUSIVE, LWLockAcquire(), LWLockUpdateVar(), NUM_XLOGINSERT_LOCKS, PG_UINT64_MAX, and WALInsertLocks.
Referenced by CreateCheckPoint(), CreateEndOfRecoveryRecord(), CreateRestartPoint(), do_pg_abort_backup(), do_pg_backup_start(), do_pg_backup_stop(), UpdateFullPageWrites(), and XLogInsertRecord().
Definition at line 1451 of file xlog.c.
References holdingAllLocks, i, WALInsertLock::insertingAt, WALInsertLockPadded::l, LWLockReleaseClearVar(), MyLockNo, NUM_XLOGINSERT_LOCKS, and WALInsertLocks.
Referenced by CreateCheckPoint(), CreateEndOfRecoveryRecord(), CreateOverwriteContrecordRecord(), CreateRestartPoint(), do_pg_abort_backup(), do_pg_backup_start(), do_pg_backup_stop(), UpdateFullPageWrites(), and XLogInsertRecord().
|
static |
Definition at line 1477 of file xlog.c.
References holdingAllLocks, WALInsertLock::insertingAt, WALInsertLockPadded::l, LWLockUpdateVar(), MyLockNo, NUM_XLOGINSERT_LOCKS, and WALInsertLocks.
Referenced by GetXLogBuffer().
| Size WALReadFromBuffers | ( | char * | dstbuf, |
| XLogRecPtr | startptr, | ||
| Size | count, | ||
| TimeLineID | tli | ||
| ) |
Definition at line 1754 of file xlog.c.
References Assert, ereport, errmsg(), ERROR, fb(), GetWALInsertionTimeLine(), idx(), XLogCtlData::logInsertResult, LSN_FORMAT_ARGS, Min, XLogCtlData::pages, pg_atomic_read_u64(), pg_read_barrier, RecoveryInProgress(), XLogCtlData::xlblocks, XLogCtl, XLogRecPtrIsValid, and XLogRecPtrToBufIdx.
Referenced by XLogSendPhysical().
Definition at line 4276 of file xlog.c.
References BasicOpenFile(), ControlFileData::blcksz, CATALOG_VERSION_NO, ControlFileData::catalog_version_no, close, COMP_CRC32C, ControlFile, ControlFileData::crc, crc, ControlFileData::default_char_signedness, ereport, errcode_for_file_access(), errmsg(), fb(), fd(), FIN_CRC32C, ControlFileData::float8ByVal, ControlFileData::floatFormat, FLOATFORMAT_VALUE, INDEX_MAX_KEYS, ControlFileData::indexMaxKeys, INIT_CRC32C, ControlFileData::loblksize, LOBLKSIZE, ControlFileData::maxAlign, ControlFileData::nameDataLen, NAMEDATALEN, PANIC, PG_BINARY, PG_CONTROL_FILE_SIZE, PG_CONTROL_VERSION, ControlFileData::pg_control_version, pg_fsync(), pgstat_report_wait_end(), pgstat_report_wait_start(), ControlFileData::relseg_size, ControlFileData::slru_pages_per_segment, SLRU_PAGES_PER_SEGMENT, TOAST_MAX_CHUNK_SIZE, ControlFileData::toast_max_chunk_size, wal_segment_size, write, ControlFileData::xlog_blcksz, XLOG_CONTROL_FILE, and ControlFileData::xlog_seg_size.
Referenced by BootStrapXLOG().
| void xlog_redo | ( | XLogReaderState * | record | ) |
Definition at line 8370 of file xlog.c.
References ArchiveRecoveryRequested, Assert, ControlFileData::backupEndPoint, ControlFileData::backupStartPoint, BLK_RESTORED, ControlFileData::checkPointCopy, CheckRequiredParameterValues(), CommitTsParameterChange(), ControlFile, DEBUG1, DisableLogicalDecoding(), elog, EnableLogicalDecoding(), XLogReaderState::EndRecPtr, ereport, errmsg(), ERROR, fb(), FullTransactionIdPrecedes, GetCurrentReplayRecPtr(), InArchiveRecovery, XLogCtlData::info_lck, InHotStandby, InRecovery, InvalidateObsoleteReplicationSlots(), InvalidOid, InvalidTransactionId, kill, XLogCtlData::lastFpwDisableRecPtr, lastFullPageWrites, RunningTransactionsData::latestCompletedXid, LocalMinRecoveryPoint, LocalMinRecoveryPointTLI, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), ControlFileData::max_locks_per_xact, ControlFileData::max_prepared_xacts, ControlFileData::max_wal_senders, ControlFileData::max_worker_processes, ControlFileData::MaxConnections, ControlFileData::minRecoveryPoint, ControlFileData::minRecoveryPointTLI, MultiXactAdvanceNextMXact(), MultiXactAdvanceOldest(), MultiXactSetNextMXact(), CheckPoint::nextMulti, CheckPoint::nextMultiOffset, TransamVariablesData::nextOid, CheckPoint::nextOid, TransamVariablesData::nextXid, CheckPoint::nextXid, RunningTransactionsData::nextXid, TransamVariablesData::oidCount, CheckPoint::oldestMulti, CheckPoint::oldestMultiDB, RunningTransactionsData::oldestRunningXid, TransamVariablesData::oldestXid, CheckPoint::oldestXid, CheckPoint::oldestXidDB, PANIC, PostmasterPid, PrescanPreparedTransactions(), ProcArrayApplyRecoveryInfo(), XLogReaderState::ReadRecPtr, RecoveryRestartPoint(), RS_INVAL_WAL_LEVEL, SetTransactionIdLimit(), SIGUSR1, smgrdestroyall(), SpinLockAcquire, SpinLockRelease, STANDBY_INITIALIZED, StandbyRecoverPreparedTransactions(), standbyState, RunningTransactionsData::subxcnt, RunningTransactionsData::subxid_status, SUBXIDS_IN_SUBTRANS, sync_replication_slots, CheckPoint::ThisTimeLineID, ControlFileData::track_commit_timestamp, TransactionIdIsNormal, TransactionIdPrecedes(), TransactionIdRetreat, TransamVariables, UnlockReleaseBuffer(), UpdateControlFile(), ControlFileData::wal_level, ControlFileData::wal_log_hints, RunningTransactionsData::xcnt, XidFromFullTransactionId, RunningTransactionsData::xids, XLOG_BACKUP_END, XLOG_CHECKPOINT_ONLINE, XLOG_CHECKPOINT_REDO, XLOG_CHECKPOINT_SHUTDOWN, XLOG_END_OF_RECOVERY, XLOG_FPI, XLOG_FPI_FOR_HINT, XLOG_FPW_CHANGE, XLOG_LOGICAL_DECODING_STATUS_CHANGE, XLOG_NEXTOID, XLOG_NOOP, XLOG_OVERWRITE_CONTRECORD, XLOG_PARAMETER_CHANGE, XLOG_RESTORE_POINT, XLOG_SWITCH, XLogCtl, XLogReadBufferForRedo(), XLogRecGetData, XLogRecGetInfo, XLogRecHasAnyBlockRefs, XLogRecHasBlockImage, XLogRecMaxBlockId, and XLogRecPtrIsValid.
Definition at line 2988 of file xlog.c.
References AdvanceXLInsertBuffer(), XLogCtlData::asyncXactLSN, elog, END_CRIT_SECTION, fb(), XLogwrtResult::Flush, GetCurrentTimestamp(), XLogCtlData::info_lck, XLogCtlData::InsertTimeLineID, InvalidXLogRecPtr, LOG, LogwrtResult, XLogCtlData::LogwrtRqst, LSN_FORMAT_ARGS, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), WaitLSNState::minWaitedLSN, now(), openLogFile, openLogSegNo, pg_atomic_read_u64(), RecoveryInProgress(), RefreshXLogWriteResult, SpinLockAcquire, SpinLockRelease, START_CRIT_SECTION, TimestampDifferenceExceeds(), WAIT_LSN_TYPE_PRIMARY_FLUSH, waitLSNState, WaitLSNWakeup(), WaitXLogInsertionsToFinish(), wal_segment_size, WalSndWakeupProcessRequests(), WalWriterDelay, WalWriterFlushAfter, XLogwrtResult::Write, XLByteInPrevSeg, XLogCtl, XLogFileClose(), and XLogWrite().
Referenced by WalSndWaitForWal(), and WalWriterMain().
|
static |
Definition at line 1904 of file xlog.c.
References fb(), SizeOfXLogLongPHD, SizeOfXLogShortPHD, UsableBytesInPage, UsableBytesInSegment, wal_segment_size, and XLogSegNoOffsetToRecPtr.
Referenced by ReserveXLogInsertLocation(), ReserveXLogSwitch(), and WaitXLogInsertionsToFinish().
|
static |
Definition at line 1864 of file xlog.c.
References fb(), SizeOfXLogLongPHD, SizeOfXLogShortPHD, UsableBytesInPage, UsableBytesInSegment, wal_segment_size, and XLogSegNoOffsetToRecPtr.
Referenced by CreateCheckPoint(), GetXLogInsertRecPtr(), ReserveXLogInsertLocation(), and ReserveXLogSwitch().
Definition at line 2283 of file xlog.c.
References CheckPointSegments, fb(), RedoRecPtr, wal_segment_size, and XLByteToSeg.
Referenced by XLogPageRead(), and XLogWrite().
Definition at line 4693 of file xlog.c.
References fb(), NBuffers, and wal_segment_size.
Referenced by check_wal_buffers(), and XLOGShmemSize().
Definition at line 3676 of file xlog.c.
References Assert, close, ereport, errcode_for_file_access(), errmsg(), fb(), io_direct_flags, IO_DIRECT_WAL, MAXFNAMELEN, openLogFile, openLogSegNo, openLogTLI, PANIC, ReleaseExternalFD(), wal_segment_size, XLogFileName(), and XLogIsNeeded.
Referenced by assign_wal_sync_method(), XLogBackgroundFlush(), and XLogWrite().
|
static |
Definition at line 3455 of file xlog.c.
References CloseTransientFile(), PGAlignedXLogBlock::data, data_sync_elevel(), elog, ereport, errcode(), ERRCODE_DATA_CORRUPTED, errcode_for_file_access(), errmsg(), ERROR, fb(), fd(), InstallXLogFileSegment(), MAXPGPATH, OpenTransientFile(), PG_BINARY, pg_fsync(), pgstat_report_wait_end(), pgstat_report_wait_start(), read, snprintf, wal_segment_size, write, XLOGDIR, and XLogFilePath().
Referenced by XLogInitNewTimeline().
| int XLogFileInit | ( | XLogSegNo | logsegno, |
| TimeLineID | logtli | ||
| ) |
Definition at line 3417 of file xlog.c.
References Assert, BasicOpenFile(), ereport, errcode_for_file_access(), errmsg(), ERROR, fb(), fd(), get_sync_bit(), MAXPGPATH, O_CLOEXEC, PG_BINARY, wal_sync_method, and XLogFileInitInternal().
Referenced by BootStrapXLOG(), XLogInitNewTimeline(), XLogWalRcvWrite(), and XLogWrite().
|
static |
Definition at line 3229 of file xlog.c.
References Assert, BasicOpenFile(), CheckPointSegments, close, DEBUG2, elog, ereport, errcode_for_file_access(), errmsg(), ERROR, fb(), fd(), get_sync_bit(), InstallXLogFileSegment(), io_direct_flags, IO_DIRECT_WAL_INIT, IOCONTEXT_INIT, IOOBJECT_WAL, IOOP_FSYNC, IOOP_WRITE, MAXPGPATH, O_CLOEXEC, PG_BINARY, pg_fsync(), PG_O_DIRECT, pg_pwrite, pg_pwrite_zeros(), pgstat_count_io_op_time(), pgstat_prepare_io_time(), pgstat_report_wait_end(), pgstat_report_wait_start(), snprintf, track_wal_io_timing, wal_init_zero, wal_segment_size, wal_sync_method, XLOGDIR, and XLogFilePath().
Referenced by PreallocXlogFiles(), and XLogFileInit().
| int XLogFileOpen | ( | XLogSegNo | segno, |
| TimeLineID | tli | ||
| ) |
Definition at line 3655 of file xlog.c.
References BasicOpenFile(), ereport, errcode_for_file_access(), errmsg(), fb(), fd(), get_sync_bit(), MAXPGPATH, O_CLOEXEC, PANIC, PG_BINARY, wal_segment_size, wal_sync_method, and XLogFilePath().
Referenced by XLogWrite().
|
static |
Definition at line 2233 of file xlog.c.
References CheckPointCompletionTarget, CheckPointDistanceEstimate, ConvertToXSegs, fb(), max_wal_size_mb, min_wal_size_mb, and wal_segment_size.
Referenced by RemoveOldXlogFiles().
| void XLogFlush | ( | XLogRecPtr | record | ) |
Definition at line 2783 of file xlog.c.
References Assert, CommitDelay, CommitSiblings, elog, enableFsync, END_CRIT_SECTION, ERROR, fb(), XLogwrtResult::Flush, XLogCtlData::info_lck, XLogCtlData::InsertTimeLineID, LOG, LogwrtResult, XLogCtlData::LogwrtRqst, LSN_FORMAT_ARGS, LW_EXCLUSIVE, LWLockAcquireOrWait(), LWLockRelease(), MinimumActiveBackends(), WaitLSNState::minWaitedLSN, pg_atomic_read_u64(), pg_usleep(), pgstat_report_wait_end(), pgstat_report_wait_start(), RecoveryInProgress(), RefreshXLogWriteResult, SpinLockAcquire, SpinLockRelease, START_CRIT_SECTION, UpdateMinRecoveryPoint(), WAIT_LSN_TYPE_PRIMARY_FLUSH, waitLSNState, WaitLSNWakeup(), WaitXLogInsertionsToFinish(), WalSndWakeupProcessRequests(), XLogwrtRqst::Write, XLogwrtResult::Write, XLogCtl, XLogInsertAllowed(), XLogNeedsFlush(), and XLogWrite().
Referenced by CheckPointReplicationOrigin(), CreateCheckPoint(), CreateEndOfRecoveryRecord(), CreateOverwriteContrecordRecord(), dropdb(), EndPrepare(), FinishSyncWorker(), FlushBuffer(), LogLogicalMessage(), pg_truncate_visibility_map(), RecordTransactionAbortPrepared(), RecordTransactionCommit(), RecordTransactionCommitPrepared(), RelationTruncate(), ReplicationSlotReserveWal(), replorigin_get_progress(), replorigin_session_get_progress(), SlruPhysicalWritePage(), smgr_redo(), write_logical_decoding_status_update_record(), write_relmap_file(), WriteMTruncateXlogRec(), WriteTruncateXlogRec(), xact_redo_abort(), xact_redo_commit(), XLogInsertRecord(), and XLogReportParameters().
Definition at line 3795 of file xlog.c.
References XLogCtlData::info_lck, XLogCtlData::lastRemovedSegNo, SpinLockAcquire, SpinLockRelease, and XLogCtl.
Referenced by copy_replication_slot(), GetWALAvailability(), ReplicationSlotReserveWal(), and reserve_wal_for_local_slot().
| XLogSegNo XLogGetOldestSegno | ( | TimeLineID | tli | ) |
Definition at line 3811 of file xlog.c.
References AllocateDir(), fb(), FreeDir(), IsXLogFileName(), ReadDir(), wal_segment_size, XLOGDIR, and XLogFromFileName().
Referenced by GetOldestUnsummarizedLSN(), and MaybeRemoveOldWalSummaries().
| XLogRecPtr XLogGetReplicationSlotMinimumLSN | ( | void | ) |
Definition at line 2682 of file xlog.c.
References XLogCtlData::info_lck, XLogCtlData::replicationSlotMinLSN, SpinLockAcquire, SpinLockRelease, and XLogCtl.
Referenced by KeepLogSeg(), and reserve_wal_for_local_slot().
|
static |
Definition at line 5302 of file xlog.c.
References Assert, close, ereport, errcode_for_file_access(), errmsg(), ERROR, fb(), fd(), InvalidXLogRecPtr, MAXFNAMELEN, UpdateMinRecoveryPoint(), wal_segment_size, XLByteToPrevSeg, XLByteToSeg, XLogArchiveCleanup(), XLogFileCopy(), XLogFileInit(), XLogFileName(), and XLogSegmentOffset.
Referenced by StartupXLOG().
Definition at line 6515 of file xlog.c.
References LocalXLogInsertAllowed, and RecoveryInProgress().
Referenced by XLogBeginInsert(), XLogFlush(), XLogInsertRecord(), and XLogNeedsFlush().
| XLogRecPtr XLogInsertRecord | ( | XLogRecData * | rdata, |
| XLogRecPtr | fpw_lsn, | ||
| uint8 | flags, | ||
| int | num_fpi, | ||
| uint64 | fpi_bytes, | ||
| bool | topxid_included | ||
| ) |
Definition at line 749 of file xlog.c.
References appendBinaryStringInfo(), appendStringInfo(), appendStringInfoString(), Assert, buf, COMP_CRC32C, CopyXLogRecordToWAL(), DecodeXLogRecord(), DecodeXLogRecordRequiredSpace(), doPageWrites, elog, END_CRIT_SECTION, ERROR, fb(), FIN_CRC32C, holdingAllLocks, XLogCtlData::info_lck, initStringInfo(), XLogCtlData::Insert, Insert(), XLogCtlData::InsertTimeLineID, InvalidXLogRecPtr, WALInsertLockPadded::l, WALInsertLock::lastImportantAt, likely, LOG, LogwrtResult, XLogCtlData::LogwrtRqst, LSN_FORMAT_ARGS, MarkCurrentTransactionIdLoggedIfAny(), MarkSubxactTopXidLogged(), MemoryContextSwitchTo(), MyLockNo, palloc(), pfree(), pgstat_report_fixed, pgWalUsage, ProcLastRecPtr, RedoRecPtr, RefreshXLogWriteResult, ReserveXLogInsertLocation(), ReserveXLogSwitch(), SizeOfXLogLongPHD, SizeOfXLogRecord, SizeOfXLogShortPHD, SpinLockAcquire, SpinLockRelease, START_CRIT_SECTION, unlikely, WalUsage::wal_bytes, WalUsage::wal_fpi, WalUsage::wal_fpi_bytes, WalUsage::wal_records, wal_segment_size, WALINSERT_NORMAL, WALINSERT_SPECIAL_CHECKPOINT, WALINSERT_SPECIAL_SWITCH, WALInsertLockAcquire(), WALInsertLockAcquireExclusive(), WALInsertLockRelease(), WALInsertLocks, XLogwrtRqst::Write, XactLastRecEnd, XL_ROUTINE, XLogRecord::xl_tot_len, XLOG_CHECKPOINT_REDO, XLOG_MARK_UNIMPORTANT, xlog_outdesc(), XLOG_SWITCH, XLogCtl, XLogFlush(), XLogInsertAllowed(), XLogReaderAllocate(), XLogRecPtrIsValid, and XLogSegmentOffset.
Referenced by XLogInsert().
| bool XLogNeedsFlush | ( | XLogRecPtr | record | ) |
Definition at line 3145 of file xlog.c.
References ControlFile, fb(), XLogwrtResult::Flush, InRecovery, LocalMinRecoveryPoint, LocalMinRecoveryPointTLI, LogwrtResult, LW_SHARED, LWLockConditionalAcquire(), LWLockRelease(), ControlFileData::minRecoveryPoint, ControlFileData::minRecoveryPointTLI, RefreshXLogWriteResult, updateMinRecoveryPoint, XLogInsertAllowed(), and XLogRecPtrIsValid.
Referenced by GetVictimBuffer(), SetHintBits(), and XLogFlush().
Definition at line 8158 of file xlog.c.
References fb(), XLOG_NEXTOID, XLogBeginInsert(), XLogInsert(), and XLogRegisterData().
Referenced by GetNewObjectId().
|
static |
Definition at line 1947 of file xlog.c.
References Assert, fb(), SizeOfXLogLongPHD, SizeOfXLogShortPHD, UsableBytesInPage, UsableBytesInSegment, wal_segment_size, XLByteToSeg, and XLogSegmentOffset.
Referenced by ReserveXLogInsertLocation(), ReserveXLogSwitch(), and StartupXLOG().
Definition at line 8238 of file xlog.c.
References ControlFile, fb(), LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), max_locks_per_xact, ControlFileData::max_locks_per_xact, max_prepared_xacts, ControlFileData::max_prepared_xacts, max_wal_senders, ControlFileData::max_wal_senders, max_worker_processes, ControlFileData::max_worker_processes, MaxConnections, xl_parameter_change::MaxConnections, ControlFileData::MaxConnections, track_commit_timestamp, ControlFileData::track_commit_timestamp, UpdateControlFile(), wal_level, ControlFileData::wal_level, wal_log_hints, ControlFileData::wal_log_hints, XLOG_PARAMETER_CHANGE, XLogBeginInsert(), XLogFlush(), XLogInsert(), XLogIsNeeded, and XLogRegisterData().
Referenced by StartupXLOG().
| XLogRecPtr XLogRestorePoint | ( | const char * | rpName | ) |
Definition at line 8213 of file xlog.c.
References ereport, errmsg(), fb(), GetCurrentTimestamp(), LOG, LSN_FORMAT_ARGS, MAXFNAMELEN, xl_restore_point::rp_time, strlcpy(), XLOG_RESTORE_POINT, XLogBeginInsert(), XLogInsert(), and XLogRegisterData().
Referenced by pg_create_restore_point().
| void XLogSetAsyncXactLSN | ( | XLogRecPtr | asyncXactLSN | ) |
Definition at line 2612 of file xlog.c.
References XLogCtlData::asyncXactLSN, fb(), XLogwrtResult::Flush, GetPGProcByNumber, XLogCtlData::info_lck, INVALID_PROC_NUMBER, LogwrtResult, ProcGlobal, RefreshXLogWriteResult, SetLatch(), SpinLockAcquire, SpinLockRelease, wakeup, WalWriterFlushAfter, PROC_HDR::walwriterProc, XLogCtlData::WalWriterSleeping, and XLogCtl.
Referenced by AbortTransaction(), LogCurrentRunningXacts(), RecordTransactionAbort(), and RecordTransactionCommit().
| void XLogSetReplicationSlotMinimumLSN | ( | XLogRecPtr | lsn | ) |
Definition at line 2669 of file xlog.c.
References XLogCtlData::info_lck, XLogCtlData::replicationSlotMinLSN, SpinLockAcquire, SpinLockRelease, and XLogCtl.
Referenced by ReplicationSlotsComputeRequiredLSN().
Definition at line 5011 of file xlog.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, ControlFile, fb(), i, XLogCtlData::info_lck, XLogCtlData::Insert, XLogCtlInsert::insertpos_lck, XLogCtlData::InstallXLogFileSegmentActive, InvalidXLogRecPtr, WALInsertLockPadded::l, WALInsertLock::lastImportantAt, XLogCtlData::logFlushResult, XLogCtlData::logInsertResult, XLogCtlData::logWriteResult, LWLockInitialize(), MemoryContextAllowInCriticalSection(), NUM_XLOGINSERT_LOCKS, XLogCtlData::pages, pfree(), pg_atomic_init_u64(), RECOVERY_STATE_CRASH, XLogCtlData::SharedRecoveryState, ShmemInitStruct(), SpinLockInit, TopMemoryContext, TYPEALIGN, XLogCtlData::unloggedLSN, XLogCtlInsert::WALInsertLocks, WALInsertLocks, XLogCtlData::WalWriterSleeping, XLogCtlData::xlblocks, XLOGbuffers, XLogCtlData::XLogCacheBlck, XLogCtl, and XLOGShmemSize().
Referenced by CreateOrAttachShmemStructs().
Definition at line 4961 of file xlog.c.
References add_size(), Assert, buf, fb(), Max, mul_size(), NUM_XLOGINSERT_LOCKS, PG_IO_ALIGN_SIZE, PGC_POSTMASTER, PGC_S_DYNAMIC_DEFAULT, PGC_S_OVERRIDE, SetConfigOption(), snprintf, XLOGbuffers, and XLOGChooseNumBuffers().
Referenced by CalculateShmemSize(), and XLOGShmemInit().
Definition at line 9636 of file xlog.c.
References AmStartupProcess, Assert, IsUnderPostmaster, ResetInstallXLogFileSegmentActive(), and ShutdownWalRcv().
Referenced by FinishWalRecovery(), and WaitForWALToBecomeAvailable().
|
static |
Definition at line 2307 of file xlog.c.
References Assert, CHECKPOINT_CAUSE_XLOG, CritSectionCount, EINTR, elog, ereport, errcode_for_file_access(), errmsg(), fb(), XLogwrtRqst::Flush, XLogwrtResult::Flush, Flush, GetRedoRecPtr(), XLogCtlData::info_lck, Insert(), IOCONTEXT_NORMAL, IOOBJECT_WAL, IOOP_WRITE, issue_xlog_fsync(), IsUnderPostmaster, XLogCtlData::lastSegSwitchLSN, XLogCtlData::lastSegSwitchTime, XLogCtlData::logFlushResult, XLogCtlData::logInsertResult, XLogCtlData::logWriteResult, LogwrtResult, XLogCtlData::LogwrtRqst, LSN_FORMAT_ARGS, MAXFNAMELEN, NextBufIdx, openLogFile, openLogSegNo, openLogTLI, XLogCtlData::pages, PANIC, pg_atomic_read_u64(), pg_atomic_write_u64(), pg_pwrite, pg_read_barrier, pg_write_barrier, pgstat_count_io_op_time(), pgstat_prepare_io_time(), pgstat_report_wait_end(), pgstat_report_wait_start(), RefreshXLogWriteResult, RequestCheckpoint(), ReserveExternalFD(), SpinLockAcquire, SpinLockRelease, start, track_wal_io_timing, wal_segment_size, wal_sync_method, WAL_SYNC_METHOD_OPEN, WAL_SYNC_METHOD_OPEN_DSYNC, WalSndWakeupRequest, XLogwrtRqst::Write, XLogwrtResult::Write, Write, XLogCtlData::xlblocks, XLByteInPrevSeg, XLByteToPrevSeg, XLogArchiveNotifySeg(), XLogArchivingActive, XLogCtlData::XLogCacheBlck, XLogCheckpointNeeded(), XLogCtl, XLogFileClose(), XLogFileInit(), XLogFileName(), XLogFileOpen(), XLogRecPtrToBufIdx, and XLogSegmentOffset.
Referenced by AdvanceXLInsertBuffer(), XLogBackgroundFlush(), and XLogFlush().
| const struct config_enum_entry archive_mode_options[] |
Definition at line 169 of file xlog.c.
Referenced by check_wal_consistency_checking(), and InitializeWalConsistencyChecking().
|
static |
Definition at line 162 of file xlog.c.
Referenced by LogCheckpointEnd(), UpdateCheckPointDistanceEstimate(), and XLOGfileslop().
| int CheckPointSegments |
Definition at line 159 of file xlog.c.
Referenced by CalculateCheckpointSegments(), IsCheckpointOnSchedule(), XLogCheckpointNeeded(), and XLogFileInitInternal().
| CheckpointStatsData CheckpointStats |
Definition at line 212 of file xlog.c.
Referenced by BufferSync(), CheckPointGuts(), CreateCheckPoint(), CreateRestartPoint(), LogCheckpointEnd(), PreallocXlogFiles(), ProcessSyncRequests(), RemoveXlogFile(), and SlruInternalWritePage().
| int CommitDelay = 0 |
Definition at line 135 of file xlog.c.
Referenced by XLogFlush().
| int CommitSiblings = 5 |
Definition at line 136 of file xlog.c.
Referenced by XLogFlush().
|
static |
Definition at line 576 of file xlog.c.
Referenced by AdvanceXLInsertBuffer(), BootStrapXLOG(), checkControlFile(), CheckRequiredParameterValues(), CreateCheckPoint(), CreateEndOfRecoveryRecord(), CreateRestartPoint(), DataChecksumsEnabled(), digestControlFile(), do_pg_backup_start(), do_pg_backup_stop(), get_controlfile_by_exact_path(), GetActiveWalLevelOnStandby(), GetDefaultCharSignedness(), GetMockAuthenticationNonce(), GetOldestRestartPoint(), GetSystemIdentifier(), InitControlFile(), InitWalRecovery(), LocalProcessControlFile(), LogCheckpointEnd(), main(), pg_control_checkpoint(), pg_control_init(), pg_control_recovery(), pg_control_system(), ReachedEndOfBackup(), ReadControlFile(), StartupXLOG(), SwitchIntoArchiveRecovery(), update_controlfile(), UpdateControlFile(), UpdateMinRecoveryPoint(), WriteControlFile(), xlog_redo(), XLogNeedsFlush(), XLogReportParameters(), and XLOGShmemInit().
|
static |
Definition at line 289 of file xlog.c.
Referenced by GetFullPageWriteInfo(), StartupXLOG(), XLogCheckBufferNeedsBackup(), XLogInsert(), XLogInsertRecord(), and XLogRecordAssemble().
Definition at line 124 of file xlog.c.
Referenced by BackendInitialize(), CheckRequiredParameterValues(), CreateRestartPoint(), ProcArrayShmemInit(), ProcArrayShmemSize(), process_pm_pmsignal(), RestoreSlotFromDisk(), StartupXLOG(), and validateRecoveryParameters().
Definition at line 125 of file xlog.c.
Referenced by BootStrapXLOG(), and UpdateFullPageWrites().
Definition at line 654 of file xlog.c.
Referenced by WALInsertLockAcquireExclusive(), WALInsertLockRelease(), WALInsertLockUpdateInsertingAt(), and XLogInsertRecord().
|
static |
Definition at line 220 of file xlog.c.
Referenced by StartupXLOG(), and xlog_redo().
|
static |
Definition at line 648 of file xlog.c.
Referenced by CreateRestartPoint(), StartupXLOG(), SwitchIntoArchiveRecovery(), UpdateMinRecoveryPoint(), xlog_redo(), and XLogNeedsFlush().
|
static |
Definition at line 649 of file xlog.c.
Referenced by CreateRestartPoint(), StartupXLOG(), SwitchIntoArchiveRecovery(), UpdateMinRecoveryPoint(), xlog_redo(), and XLogNeedsFlush().
Definition at line 227 of file xlog.c.
Referenced by RecoveryInProgress().
|
static |
Definition at line 239 of file xlog.c.
Referenced by CreateCheckPoint(), LocalSetXLogInsertAllowed(), and XLogInsertAllowed().
Definition at line 132 of file xlog.c.
Referenced by CheckPointTwoPhase(), CreateCheckPoint(), CreateRestartPoint(), LogCheckpointEnd(), and ProcessSyncRequests().
|
static |
Definition at line 614 of file xlog.c.
Referenced by AdvanceXLInsertBuffer(), GetFlushRecPtr(), GetXLogWriteRecPtr(), StartupXLOG(), XLogBackgroundFlush(), XLogFlush(), XLogInsertRecord(), XLogNeedsFlush(), XLogSetAsyncXactLSN(), and XLogWrite().
| int max_slot_wal_keep_size_mb = -1 |
Definition at line 138 of file xlog.c.
Referenced by KeepLogSeg(), and pg_get_replication_slots().
| int max_wal_size_mb = 1024 |
Definition at line 117 of file xlog.c.
Referenced by assign_max_wal_size(), CalculateCheckpointSegments(), GetWALAvailability(), ReadControlFile(), and XLOGfileslop().
| int min_wal_size_mb = 80 |
Definition at line 118 of file xlog.c.
Referenced by ReadControlFile(), and XLOGfileslop().
|
static |
Definition at line 653 of file xlog.c.
Referenced by WALInsertLockAcquire(), WALInsertLockRelease(), WALInsertLockUpdateInsertingAt(), and XLogInsertRecord().
|
static |
Definition at line 637 of file xlog.c.
Referenced by assign_wal_sync_method(), BootStrapXLOG(), XLogBackgroundFlush(), XLogFileClose(), and XLogWrite().
|
static |
Definition at line 638 of file xlog.c.
Referenced by assign_wal_sync_method(), XLogBackgroundFlush(), XLogFileClose(), and XLogWrite().
|
static |
Definition at line 639 of file xlog.c.
Referenced by assign_wal_sync_method(), BootStrapXLOG(), XLogFileClose(), and XLogWrite().
|
static |
Definition at line 163 of file xlog.c.
Referenced by LogCheckpointEnd(), and UpdateCheckPointDistanceEstimate().
| XLogRecPtr ProcLastRecPtr = InvalidXLogRecPtr |
Definition at line 256 of file xlog.c.
Referenced by CreateCheckPoint(), CreateOverwriteContrecordRecord(), EndPrepare(), and XLogInsertRecord().
|
static |
Definition at line 276 of file xlog.c.
Referenced by CreateCheckPoint(), CreateRestartPoint(), GetFullPageWriteInfo(), GetRedoRecPtr(), StartupXLOG(), XLogCheckBufferNeedsBackup(), XLogCheckpointNeeded(), XLogInsert(), XLogInsertRecord(), XLogRecordAssemble(), and XLogSaveBufferForHint().
|
static |
Definition at line 394 of file xlog.c.
Referenced by do_pg_abort_backup(), do_pg_backup_start(), do_pg_backup_stop(), and get_backup_status().
Definition at line 140 of file xlog.c.
Referenced by issue_xlog_fsync(), pgstat_count_backend_io_op_time(), WALRead(), XLogFileInitInternal(), XLogPageRead(), XLogWalRcvWrite(), and XLogWrite().
Definition at line 650 of file xlog.c.
Referenced by SwitchIntoArchiveRecovery(), UpdateMinRecoveryPoint(), and XLogNeedsFlush().
|
static |
Definition at line 608 of file xlog.c.
Referenced by ReadControlFile(), XLogBytePosToEndRecPtr(), XLogBytePosToRecPtr(), and XLogRecPtrToBytePos().
| int wal_compression = WAL_COMPRESSION_NONE |
Definition at line 127 of file xlog.c.
Referenced by XLogCompressBackupBlock(), and XLogRecordAssemble().
Definition at line 129 of file xlog.c.
Referenced by assign_wal_consistency_checking(), and XLogRecordAssemble().
Definition at line 128 of file xlog.c.
Referenced by InitializeWalConsistencyChecking().
| int wal_decode_buffer_size = 512 * 1024 |
Definition at line 139 of file xlog.c.
Referenced by InitWalRecovery().
Definition at line 130 of file xlog.c.
Referenced by XLogFileInitInternal().
| int wal_keep_size_mb = 0 |
Definition at line 119 of file xlog.c.
Referenced by KeepLogSeg(), and pg_get_replication_slots().
| int wal_level = WAL_LEVEL_REPLICA |
Definition at line 134 of file xlog.c.
Referenced by BootStrapXLOG(), check_new_cluster_replication_slots(), check_publisher(), CheckLogicalDecodingRequirements(), CheckSlotRequirements(), CheckSubDeadTupleRetention(), CreateCheckPoint(), CreateEndOfRecoveryRecord(), CreatePublication(), DisableLogicalDecodingIfNecessary(), EnsureLogicalDecodingEnabled(), get_wal_level_string(), InitControlFile(), PostmasterMain(), RequestDisableLogicalDecoding(), RestoreSlotFromDisk(), show_effective_wal_level(), StartupLogicalDecodingStatus(), UpdateLogicalDecodingStatusEndOfRecovery(), wal_level_str(), xlog_desc(), and XLogReportParameters().
Definition at line 126 of file xlog.c.
Referenced by InitControlFile(), and XLogReportParameters().
Definition at line 131 of file xlog.c.
Referenced by RemoveXlogFile().
| int wal_retrieve_retry_interval = 5000 |
Definition at line 137 of file xlog.c.
Referenced by ApplyLauncherMain(), launch_sync_worker(), and WaitForWALToBecomeAvailable().
| int wal_segment_size = DEFAULT_XLOG_SEG_SIZE |
Definition at line 146 of file xlog.c.
Referenced by AdvanceXLInsertBuffer(), assign_wal_sync_method(), BootStrapXLOG(), build_backup_content(), CalculateCheckpointSegments(), CheckArchiveTimeout(), CheckXLogRemoved(), CleanupAfterArchiveRecovery(), copy_replication_slot(), CopyXLogRecordToWAL(), CreateCheckPoint(), CreateOverwriteContrecordRecord(), CreateRestartPoint(), do_pg_backup_stop(), ExecuteRecoveryCommand(), FinishWalRecovery(), GetOldestUnsummarizedLSN(), GetWALAvailability(), GetXLogBuffer(), InitWalRecovery(), InitXLogReaderState(), InstallXLogFileSegment(), InvalidateObsoleteReplicationSlots(), IsCheckpointOnSchedule(), issue_xlog_fsync(), KeepLogSeg(), LogicalConfirmReceivedLocation(), MaybeRemoveOldWalSummaries(), perform_base_backup(), pg_control_checkpoint(), pg_get_replication_slots(), pg_split_walfile_name(), pg_walfile_name(), pg_walfile_name_offset(), PreallocXlogFiles(), ReadControlFile(), ReadRecord(), RemoveNonParentXlogFiles(), RemoveOldXlogFiles(), ReorderBufferRestoreChanges(), ReorderBufferRestoreCleanup(), ReorderBufferSerializedPath(), ReorderBufferSerializeTXN(), ReplicationSlotReserveWal(), RequestXLogStreaming(), reserve_wal_for_local_slot(), ReserveXLogSwitch(), RestoreArchivedFile(), StartReplication(), StartupDecodingContext(), SummarizeWAL(), UpdateLastRemovedPtr(), WALReadRaiseError(), WalReceiverMain(), WalSndSegmentOpen(), WriteControlFile(), XLogArchiveNotifySeg(), XLogBackgroundFlush(), XLogBytePosToEndRecPtr(), XLogBytePosToRecPtr(), XLogCheckpointNeeded(), XLOGChooseNumBuffers(), XLogFileClose(), XLogFileCopy(), XLogFileInitInternal(), XLogFileOpen(), XLogFileRead(), XLogFileReadAnyTLI(), XLOGfileslop(), XLogGetOldestSegno(), XLogInitNewTimeline(), XLogInsertRecord(), XLogPageRead(), XLogReaderAllocate(), XlogReadTwoPhaseData(), XLogRecPtrToBytePos(), XLogWalRcvClose(), XLogWalRcvWrite(), and XLogWrite().
| int wal_sync_method = DEFAULT_WAL_SYNC_METHOD |
Definition at line 133 of file xlog.c.
Referenced by assign_wal_sync_method(), issue_xlog_fsync(), pg_fsync(), XLogFileInit(), XLogFileInitInternal(), XLogFileOpen(), and XLogWrite().
| const struct config_enum_entry wal_sync_method_options[] |
|
static |
Definition at line 571 of file xlog.c.
Referenced by GetLastImportantRecPtr(), WaitXLogInsertionsToFinish(), WALInsertLockAcquire(), WALInsertLockAcquireExclusive(), WALInsertLockRelease(), WALInsertLockUpdateInsertingAt(), XLogInsertRecord(), and XLOGShmemInit().
| XLogRecPtr XactLastCommitEnd = InvalidXLogRecPtr |
Definition at line 258 of file xlog.c.
Referenced by apply_handle_commit_internal(), apply_handle_commit_prepared(), apply_handle_stream_commit(), and RecordTransactionCommit().
| XLogRecPtr XactLastRecEnd = InvalidXLogRecPtr |
Definition at line 257 of file xlog.c.
Referenced by AbortTransaction(), CommitTransaction(), dropdb(), PrepareTransaction(), RecordTransactionAbort(), RecordTransactionAbortPrepared(), RecordTransactionCommit(), RecordTransactionCommitPrepared(), WaitForParallelWorkersToFinish(), and XLogInsertRecord().
Definition at line 123 of file xlog.c.
Referenced by LoadArchiveLibrary(), ProcessPgArchInterrupts(), shell_archive_configured(), shell_archive_file(), and show_archive_command().
| int XLogArchiveMode = ARCHIVE_MODE_OFF |
Definition at line 122 of file xlog.c.
Referenced by KeepFileRestoredFromArchive(), PostmasterMain(), WalRcvFetchTimeLineHistoryFiles(), WalReceiverMain(), and XLogWalRcvClose().
| int XLogArchiveTimeout = 0 |
Definition at line 121 of file xlog.c.
Referenced by CheckArchiveTimeout(), and CheckpointerMain().
| int XLOGbuffers = -1 |
Definition at line 120 of file xlog.c.
Referenced by check_wal_buffers(), XLOGShmemInit(), and XLOGShmemSize().
|
static |
Definition at line 568 of file xlog.c.
Referenced by AdvanceXLInsertBuffer(), CheckXLogRemoved(), CreateCheckPoint(), CreateEndOfRecoveryRecord(), CreateRestartPoint(), do_pg_abort_backup(), do_pg_backup_start(), do_pg_backup_stop(), GetFakeLSNForUnloggedRel(), GetFlushRecPtr(), GetInsertRecPtr(), GetLastSegSwitchData(), GetRecoveryState(), GetRedoRecPtr(), GetWALInsertionTimeLine(), GetWALInsertionTimeLineIfSet(), GetXLogBuffer(), GetXLogInsertRecPtr(), InstallXLogFileSegment(), IsInstallXLogFileSegmentActive(), PreallocXlogFiles(), RecoveryInProgress(), RecoveryRestartPoint(), RemoveXlogFile(), ReserveXLogInsertLocation(), ReserveXLogSwitch(), ResetInstallXLogFileSegmentActive(), SetInstallXLogFileSegmentActive(), SetWalWriterSleeping(), StartupXLOG(), SwitchIntoArchiveRecovery(), UpdateFullPageWrites(), UpdateLastRemovedPtr(), WaitXLogInsertionsToFinish(), WALReadFromBuffers(), xlog_redo(), XLogBackgroundFlush(), XLogFlush(), XLogGetLastRemovedSegno(), XLogGetReplicationSlotMinimumLSN(), XLogInsertRecord(), XLogSetAsyncXactLSN(), XLogSetReplicationSlotMinimumLSN(), XLOGShmemInit(), and XLogWrite().