#include "postgres.h"
#include <sys/time.h>
#include "access/xlog.h"
#include "access/xlog_internal.h"
#include "access/xlogrecovery.h"
#include "catalog/pg_authid.h"
#include "commands/defrem.h"
#include "libpq/pqsignal.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "postmaster/auxprocess.h"
#include "postmaster/bgwriter.h"
#include "postmaster/interrupt.h"
#include "replication/syncrep.h"
#include "storage/aio_subsys.h"
#include "storage/bufmgr.h"
#include "storage/condition_variable.h"
#include "storage/fd.h"
#include "storage/ipc.h"
#include "storage/lwlock.h"
#include "storage/pmsignal.h"
#include "storage/proc.h"
#include "storage/procsignal.h"
#include "storage/shmem.h"
#include "storage/smgr.h"
#include "storage/spin.h"
#include "utils/acl.h"
#include "utils/guc.h"
#include "utils/memutils.h"
#include "utils/resowner.h"
Go to the source code of this file.
Definition at line 149 of file checkpointer.c.
Definition at line 152 of file checkpointer.c.
Definition at line 146 of file checkpointer.c.
Definition at line 1429 of file checkpointer.c.
References AmCheckpointerProcess, CheckpointerShmem, CKPT_REQ_BATCH_SIZE, END_CRIT_SECTION, CheckpointerRequest::ftag, CheckpointerShmemStruct::head, i, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), CheckpointerShmemStruct::max_requests, Min, CheckpointerShmemStruct::num_requests, palloc(), pfree(), RememberSyncRequest(), CheckpointerShmemStruct::requests, START_CRIT_SECTION, and CheckpointerRequest::type.
Referenced by CheckpointerMain(), CheckpointWriteDelay(), CreateCheckPoint(), ProcessSyncRequests(), SyncPostCheckpoint(), and SyncPreCheckpoint().
Definition at line 697 of file checkpointer.c.
References DEBUG1, elog, GetLastImportantRecPtr(), GetLastSegSwitchData(), last_xlog_switch_time, Max, now(), RecoveryInProgress(), RequestXLogSwitch(), wal_segment_size, XLogArchiveTimeout, and XLogSegmentOffset.
Referenced by CheckpointerMain(), and CheckpointWriteDelay().
Definition at line 195 of file checkpointer.c.
References AbsorbSyncRequests(), ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert(), AtEOXact_Buffers(), AtEOXact_Files(), AtEOXact_HashTables(), AtEOXact_SMgr(), AuxiliaryProcessMainCommon(), B_CHECKPOINTER, before_shmem_exit(), CheckArchiveTimeout(), CHECKPOINT_CAUSE_TIME, CHECKPOINT_CAUSE_XLOG, CHECKPOINT_END_OF_RECOVERY, CheckpointerShmemStruct::checkpointer_pid, PROC_HDR::checkpointerProc, CheckpointerShmem, CheckPointTimeout, CheckPointWarning, ckpt_active, ckpt_cached_elapsed, CheckpointerShmemStruct::ckpt_done, CheckpointerShmemStruct::ckpt_failed, CheckpointerShmemStruct::ckpt_flags, CheckpointerShmemStruct::ckpt_lck, ckpt_start_recptr, ckpt_start_time, CheckpointerShmemStruct::ckpt_started, ConditionVariableBroadcast(), ConditionVariableCancelSleep(), CreateCheckPoint(), CreateRestartPoint(), CheckpointerShmemStruct::done_cv, EmitErrorReport(), ereport, errhint(), errmsg_plural(), error_context_stack, ExitOnAnyError, FlushErrorState(), GetInsertRecPtr(), GetXLogReplayRecPtr(), HOLD_INTERRUPTS, last_checkpoint_time, last_xlog_switch_time, LOG, LWLockReleaseAll(), MemoryContextReset(), MemoryContextSwitchTo(), Min, MyBackendType, MyLatch, MyProcNumber, MyProcPid, now(), PgStat_CheckpointerStats::num_performed, PgStat_CheckpointerStats::num_requested, PgStat_CheckpointerStats::num_timed, PendingCheckpointerStats, PG_exception_stack, pg_usleep(), pgaio_error_cleanup(), pgstat_before_server_shutdown(), pgstat_report_checkpointer(), pgstat_report_wait_end(), pgstat_report_wal(), PMSIGNAL_XLOG_IS_SHUTDOWN, pqsignal, proc_exit(), ProcessCheckpointerInterrupts(), ProcGlobal, procsignal_sigusr1_handler(), RecoveryInProgress(), ReleaseAuxProcessResources(), ReqShutdownXLOG(), ResetLatch(), PgStat_CheckpointerStats::restartpoints_performed, PgStat_CheckpointerStats::restartpoints_requested, PgStat_CheckpointerStats::restartpoints_timed, RESUME_INTERRUPTS, SendPostmasterSignal(), ShutdownRequestPending, ShutdownXLOG(), ShutdownXLOGPending, SIGALRM, SIGCHLD, SIGHUP, SignalHandlerForConfigReload(), SignalHandlerForShutdownRequest(), SIGPIPE, SIGUSR1, SIGUSR2, smgrdestroyall(), SpinLockAcquire, SpinLockRelease, CheckpointerShmemStruct::start_cv, TopMemoryContext, UnBlockSig, UnlockBuffers(), UpdateSharedMemoryConfig(), WaitLatch(), WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, WL_TIMEOUT, and XLogArchiveTimeout.
Definition at line 973 of file checkpointer.c.
References CheckpointerShmem, CheckpointerShmemSize(), CheckpointerShmemStruct::ckpt_lck, ConditionVariableInit(), CheckpointerShmemStruct::done_cv, CheckpointerShmemStruct::head, MAX_CHECKPOINT_REQUESTS, CheckpointerShmemStruct::max_requests, MemSet, Min, NBuffers, ShmemInitStruct(), SpinLockInit, CheckpointerShmemStruct::start_cv, and CheckpointerShmemStruct::tail.
Referenced by CreateOrAttachShmemStructs().
Definition at line 951 of file checkpointer.c.
References add_size(), MAX_CHECKPOINT_REQUESTS, Min, mul_size(), and NBuffers.
Referenced by CalculateShmemSize(), and CheckpointerShmemInit().
Definition at line 785 of file checkpointer.c.
References AbsorbSyncRequests(), AmCheckpointerProcess, CheckArchiveTimeout(), CHECKPOINT_FAST, ConfigReloadPending, FastCheckpointRequested(), IsCheckpointOnSchedule(), MyLatch, PGC_SIGHUP, pgstat_report_checkpointer(), ProcessConfigFile(), ProcessProcSignalBarrier(), ProcSignalBarrierPending, progress, ResetLatch(), ShutdownRequestPending, ShutdownXLOGPending, UpdateSharedMemoryConfig(), WaitLatch(), WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, WL_TIMEOUT, and WRITES_PER_ABSORB.
Referenced by BufferSync().
Definition at line 1289 of file checkpointer.c.
References Assert(), CheckpointerShmem, CritSectionCount, ctl, CurrentMemoryContext, DEBUG1, ereport, errmsg_internal(), HASH_BLOBS, HASH_CONTEXT, hash_create(), hash_destroy(), HASH_ELEM, HASH_ENTER, hash_search(), CheckpointerShmemStruct::head, LWLockHeldByMe(), CheckpointerShmemStruct::max_requests, CheckpointerShmemStruct::num_requests, palloc0(), pfree(), CheckpointerShmemStruct::requests, and CheckpointerShmemStruct::tail.
Referenced by ForwardSyncRequest().
Definition at line 1006 of file checkpointer.c.
References CHECKPOINT_FAST, CHECKPOINT_FLUSH_UNLOGGED, CHECKPOINT_FORCE, CHECKPOINT_WAIT, defGetBoolean(), defGetString(), ereport, errcode(), errdetail(), errmsg(), ERROR, foreach_ptr, GetUserId(), has_privs_of_role(), mode, parser_errposition(), RecoveryInProgress(), RequestCheckpoint(), and stmt.
Referenced by standard_ProcessUtility().
Definition at line 758 of file checkpointer.c.
References CHECKPOINT_FAST, CheckpointerShmem, and CheckpointerShmemStruct::ckpt_flags.
Referenced by CheckpointWriteDelay().
Definition at line 1519 of file checkpointer.c.
References CheckpointerShmem, CheckpointerShmemStruct::ckpt_done, CheckpointerShmemStruct::ckpt_lck, SpinLockAcquire, and SpinLockRelease.
Referenced by BackgroundWriterMain().
Definition at line 1217 of file checkpointer.c.
References AmCheckpointerProcess, CheckpointerShmemStruct::checkpointer_pid, PROC_HDR::checkpointerProc, CheckpointerShmem, CompactCheckpointerRequestQueue(), elog, ERROR, CheckpointerRequest::ftag, GetPGProcByNumber, INVALID_PROC_NUMBER, IsUnderPostmaster, LW_EXCLUSIVE, LWLockAcquire(), LWLockRelease(), CheckpointerShmemStruct::max_requests, CheckpointerShmemStruct::num_requests, ProcGlobal, CheckpointerShmemStruct::requests, SetLatch(), CheckpointerShmemStruct::tail, CheckpointerRequest::type, and type.
Referenced by RegisterSyncRequest().
Definition at line 855 of file checkpointer.c.
References Assert(), CheckPointCompletionTarget, CheckPointSegments, CheckPointTimeout, ckpt_active, ckpt_cached_elapsed, ckpt_start_recptr, ckpt_start_time, elapsed_time(), GetInsertRecPtr(), gettimeofday(), GetXLogReplayRecPtr(), now(), progress, RecoveryInProgress(), and wal_segment_size.
Referenced by CheckpointWriteDelay().
Definition at line 655 of file checkpointer.c.
References ConfigReloadPending, LogMemoryContextPending, PGC_SIGHUP, ProcessConfigFile(), ProcessLogMemoryContextInterrupt(), ProcessProcSignalBarrier(), ProcSignalBarrierPending, and UpdateSharedMemoryConfig().
Referenced by CheckpointerMain().
Definition at line 934 of file checkpointer.c.
References MyLatch, SetLatch(), and ShutdownXLOGPending.
Referenced by CheckpointerMain().
Definition at line 1067 of file checkpointer.c.
References CHECK_FOR_INTERRUPTS, CHECKPOINT_FAST, CHECKPOINT_REQUESTED, CHECKPOINT_WAIT, PROC_HDR::checkpointerProc, CheckpointerShmem, CheckpointerShmemStruct::ckpt_done, CheckpointerShmemStruct::ckpt_failed, CheckpointerShmemStruct::ckpt_flags, CheckpointerShmemStruct::ckpt_lck, CheckpointerShmemStruct::ckpt_started, ConditionVariableCancelSleep(), ConditionVariablePrepareToSleep(), ConditionVariableSleep(), CreateCheckPoint(), CheckpointerShmemStruct::done_cv, elog, ereport, errhint(), errmsg(), ERROR, GetPGProcByNumber, INVALID_PROC_NUMBER, IsPostmasterEnvironment, LOG, MAX_SIGNAL_TRIES, pg_usleep(), ProcGlobal, SetLatch(), smgrdestroyall(), SpinLockAcquire, SpinLockRelease, and CheckpointerShmemStruct::start_cv.
Referenced by CreateDatabaseUsingFileCopy(), do_pg_backup_start(), dropdb(), DropTableSpace(), ExecCheckpoint(), movedb(), PerformRecoveryXLogAction(), StartupXLOG(), XLogPageRead(), and XLogWrite().
Definition at line 1500 of file checkpointer.c.
References DEBUG2, elog, SyncRepUpdateSyncStandbysDefined(), and UpdateFullPageWrites().
Referenced by CheckpointerMain(), CheckpointWriteDelay(), and ProcessCheckpointerInterrupts().
Definition at line 159 of file checkpointer.c.
Referenced by assign_checkpoint_completion_target(), CalculateCheckpointSegments(), IsCheckpointOnSchedule(), and XLOGfileslop().
Definition at line 143 of file checkpointer.c.
Referenced by AbsorbSyncRequests(), CheckpointerMain(), CheckpointerShmemInit(), CompactCheckpointerRequestQueue(), FastCheckpointRequested(), FirstCallSinceLastCheckpoint(), ForwardSyncRequest(), and RequestCheckpoint().
Definition at line 157 of file checkpointer.c.
Referenced by CheckpointerMain(), and IsCheckpointOnSchedule().
Definition at line 158 of file checkpointer.c.
Referenced by CheckpointerMain().
Definition at line 164 of file checkpointer.c.
Referenced by CheckpointerMain(), and IsCheckpointOnSchedule().
Definition at line 170 of file checkpointer.c.
Referenced by CheckpointerMain(), and IsCheckpointOnSchedule().
Definition at line 169 of file checkpointer.c.
Referenced by CheckpointerMain(), and IsCheckpointOnSchedule().
Definition at line 168 of file checkpointer.c.
Referenced by CheckpointerMain(), and IsCheckpointOnSchedule().
Definition at line 172 of file checkpointer.c.
Referenced by CheckpointerMain().
Definition at line 173 of file checkpointer.c.
Referenced by CheckArchiveTimeout(), and CheckpointerMain().
Definition at line 165 of file checkpointer.c.
Referenced by CheckpointerMain(), CheckpointWriteDelay(), and ReqShutdownXLOG().