PostgreSQL Source Code
git master
|
#include "postgres.h"
#include "access/xlog.h"
#include "access/xlogrecovery.h"
#include "access/xlogutils.h"
#include "libpq/pqsignal.h"
#include "miscadmin.h"
#include "pgstat.h"
#include "postmaster/interrupt.h"
#include "postmaster/startup.h"
#include "storage/ipc.h"
#include "storage/latch.h"
#include "storage/pmsignal.h"
#include "storage/procsignal.h"
#include "storage/standby.h"
#include "utils/guc.h"
#include "utils/memutils.h"
#include "utils/timeout.h"
Go to the source code of this file.
Macros | |
#define | POSTMASTER_POLL_RATE_LIMIT 1024 |
Functions | |
static void | StartupProcTriggerHandler (SIGNAL_ARGS) |
static void | StartupProcSigHupHandler (SIGNAL_ARGS) |
static void | StartupProcExit (int code, Datum arg) |
static void | StartupProcShutdownHandler (SIGNAL_ARGS) |
static void | StartupRereadConfig (void) |
void | HandleStartupProcInterrupts (void) |
void | StartupProcessMain (void) |
void | PreRestoreCommand (void) |
void | PostRestoreCommand (void) |
bool | IsPromoteSignaled (void) |
void | ResetPromoteSignaled (void) |
void | startup_progress_timeout_handler (void) |
void | disable_startup_progress_timeout (void) |
void | enable_startup_progress_timeout (void) |
void | begin_startup_progress_phase (void) |
bool | has_startup_progress_timeout_expired (long *secs, int *usecs) |
Variables | |
static volatile sig_atomic_t | got_SIGHUP = false |
static volatile sig_atomic_t | shutdown_requested = false |
static volatile sig_atomic_t | promote_signaled = false |
static volatile sig_atomic_t | in_restore_command = false |
static TimestampTz | startup_progress_phase_start_time |
static volatile sig_atomic_t | startup_progress_timer_expired = false |
int | log_startup_progress_interval = 10000 |
void begin_startup_progress_phase | ( | void | ) |
Definition at line 352 of file startup.c.
References disable_startup_progress_timeout(), enable_startup_progress_timeout(), and log_startup_progress_interval.
Referenced by PerformWalRecovery(), ResetUnloggedRelations(), and SyncDataDirectory().
void disable_startup_progress_timeout | ( | void | ) |
Definition at line 318 of file startup.c.
References disable_timeout(), log_startup_progress_interval, STARTUP_PROGRESS_TIMEOUT, and startup_progress_timer_expired.
Referenced by begin_startup_progress_phase(), and EnableStandbyMode().
void enable_startup_progress_timeout | ( | void | ) |
Definition at line 332 of file startup.c.
References enable_timeout_every(), GetCurrentTimestamp(), log_startup_progress_interval, startup_progress_phase_start_time, STARTUP_PROGRESS_TIMEOUT, and TimestampTzPlusMilliseconds.
Referenced by begin_startup_progress_phase().
void HandleStartupProcInterrupts | ( | void | ) |
Definition at line 168 of file startup.c.
References exit(), got_SIGHUP, IsUnderPostmaster, LogMemoryContextPending, POSTMASTER_POLL_RATE_LIMIT, PostmasterIsAlive, proc_exit(), ProcessLogMemoryContextInterrupt(), ProcessProcSignalBarrier(), ProcSignalBarrierPending, shutdown_requested, and StartupRereadConfig().
Referenced by PerformWalRecovery(), recoveryApplyDelay(), recoveryPausesHere(), RecoveryRequiresIntParameter(), and WaitForWALToBecomeAvailable().
bool has_startup_progress_timeout_expired | ( | long * | secs, |
int * | usecs | ||
) |
Definition at line 368 of file startup.c.
References GetCurrentTimestamp(), now(), startup_progress_phase_start_time, startup_progress_timer_expired, and TimestampDifference().
bool IsPromoteSignaled | ( | void | ) |
Definition at line 297 of file startup.c.
References promote_signaled.
Referenced by CheckForStandbyTrigger().
void PostRestoreCommand | ( | void | ) |
Definition at line 291 of file startup.c.
References in_restore_command.
Referenced by RestoreArchivedFile().
void PreRestoreCommand | ( | void | ) |
Definition at line 277 of file startup.c.
References in_restore_command, proc_exit(), and shutdown_requested.
Referenced by RestoreArchivedFile().
void ResetPromoteSignaled | ( | void | ) |
Definition at line 303 of file startup.c.
References promote_signaled.
Referenced by CheckForStandbyTrigger().
void startup_progress_timeout_handler | ( | void | ) |
Definition at line 312 of file startup.c.
References startup_progress_timer_expired.
Referenced by StartupXLOG().
void StartupProcessMain | ( | void | ) |
Definition at line 230 of file startup.c.
References InitializeTimeouts(), on_shmem_exit(), pqsignal(), proc_exit(), procsignal_sigusr1_handler(), RegisterTimeout(), SIG_DFL, SIG_IGN, SIGCHLD, SIGHUP, SIGPIPE, SIGUSR1, SIGUSR2, STANDBY_DEADLOCK_TIMEOUT, STANDBY_LOCK_TIMEOUT, STANDBY_TIMEOUT, StandbyDeadLockHandler(), StandbyLockTimeoutHandler(), StandbyTimeoutHandler(), StartupProcExit(), StartupProcShutdownHandler(), StartupProcSigHupHandler(), StartupProcTriggerHandler(), StartupXLOG(), and UnBlockSig.
Referenced by AuxiliaryProcessMain().
|
static |
Definition at line 217 of file startup.c.
References ShutdownRecoveryTransactionEnvironment(), STANDBY_DISABLED, and standbyState.
Referenced by StartupProcessMain().
|
static |
Definition at line 119 of file startup.c.
References in_restore_command, proc_exit(), shutdown_requested, and WakeupRecovery().
Referenced by StartupProcessMain().
|
static |
Definition at line 107 of file startup.c.
References got_SIGHUP, and WakeupRecovery().
Referenced by StartupProcessMain().
|
static |
Definition at line 95 of file startup.c.
References promote_signaled, and WakeupRecovery().
Referenced by StartupProcessMain().
|
static |
Definition at line 139 of file startup.c.
References pfree(), PGC_SIGHUP, PrimaryConnInfo, PrimarySlotName, ProcessConfigFile(), pstrdup(), StartupRequestWalReceiverRestart(), and wal_receiver_create_temp_slot.
Referenced by HandleStartupProcInterrupts().
|
static |
Definition at line 54 of file startup.c.
Referenced by HandleStartupProcInterrupts(), and StartupProcSigHupHandler().
|
static |
Definition at line 62 of file startup.c.
Referenced by PostRestoreCommand(), PreRestoreCommand(), and StartupProcShutdownHandler().
int log_startup_progress_interval = 10000 |
Definition at line 78 of file startup.c.
Referenced by begin_startup_progress_phase(), disable_startup_progress_timeout(), and enable_startup_progress_timeout().
|
static |
Definition at line 56 of file startup.c.
Referenced by IsPromoteSignaled(), ResetPromoteSignaled(), and StartupProcTriggerHandler().
|
static |
Definition at line 55 of file startup.c.
Referenced by HandleStartupProcInterrupts(), PreRestoreCommand(), and StartupProcShutdownHandler().
|
static |
Definition at line 67 of file startup.c.
Referenced by enable_startup_progress_timeout(), and has_startup_progress_timeout_expired().
|
static |
Definition at line 73 of file startup.c.
Referenced by disable_startup_progress_timeout(), has_startup_progress_timeout_expired(), and startup_progress_timeout_handler().