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 "postmaster/auxprocess.h"
#include "postmaster/startup.h"
#include "storage/ipc.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 | ProcessStartupProcInterrupts (void) |
void | StartupProcessMain (const void *startup_data, size_t startup_data_len) |
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 343 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 309 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 323 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().
bool has_startup_progress_timeout_expired | ( | long * | secs, |
int * | usecs | ||
) |
Definition at line 359 of file startup.c.
References GetCurrentTimestamp(), now(), startup_progress_phase_start_time, startup_progress_timer_expired, and TimestampDifference().
bool IsPromoteSignaled | ( | void | ) |
Definition at line 288 of file startup.c.
References promote_signaled.
Referenced by CheckForStandbyTrigger().
void PostRestoreCommand | ( | void | ) |
Definition at line 282 of file startup.c.
References in_restore_command.
Referenced by RestoreArchivedFile().
void PreRestoreCommand | ( | void | ) |
Definition at line 268 of file startup.c.
References in_restore_command, proc_exit(), and shutdown_requested.
Referenced by RestoreArchivedFile().
void ProcessStartupProcInterrupts | ( | void | ) |
Definition at line 154 of file startup.c.
References 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().
void ResetPromoteSignaled | ( | void | ) |
Definition at line 294 of file startup.c.
References promote_signaled.
Referenced by CheckForStandbyTrigger().
void startup_progress_timeout_handler | ( | void | ) |
Definition at line 303 of file startup.c.
References startup_progress_timer_expired.
Referenced by StartupXLOG().
void StartupProcessMain | ( | const void * | startup_data, |
size_t | startup_data_len | ||
) |
Definition at line 216 of file startup.c.
References Assert(), AuxiliaryProcessMainCommon(), B_STARTUP, InitializeTimeouts(), MyBackendType, on_shmem_exit(), pqsignal, proc_exit(), procsignal_sigusr1_handler(), RegisterTimeout(), SIGCHLD, SIGHUP, SIGPIPE, SIGUSR1, SIGUSR2, STANDBY_DEADLOCK_TIMEOUT, STANDBY_LOCK_TIMEOUT, STANDBY_TIMEOUT, StandbyDeadLockHandler(), StandbyLockTimeoutHandler(), StandbyTimeoutHandler(), StartupProcExit(), StartupProcShutdownHandler(), StartupProcSigHupHandler(), StartupProcTriggerHandler(), StartupXLOG(), and UnBlockSig.
|
static |
Definition at line 203 of file startup.c.
References ShutdownRecoveryTransactionEnvironment(), STANDBY_DISABLED, and standbyState.
Referenced by StartupProcessMain().
|
static |
Definition at line 109 of file startup.c.
References in_restore_command, proc_exit(), shutdown_requested, and WakeupRecovery().
Referenced by StartupProcessMain().
|
static |
Definition at line 101 of file startup.c.
References got_SIGHUP, and WakeupRecovery().
Referenced by StartupProcessMain().
|
static |
Definition at line 93 of file startup.c.
References promote_signaled, and WakeupRecovery().
Referenced by StartupProcessMain().
|
static |
Definition at line 125 of file startup.c.
References pfree(), PGC_SIGHUP, PrimaryConnInfo, PrimarySlotName, ProcessConfigFile(), pstrdup(), StartupRequestWalReceiverRestart(), and wal_receiver_create_temp_slot.
Referenced by ProcessStartupProcInterrupts().
|
static |
Definition at line 52 of file startup.c.
Referenced by ProcessStartupProcInterrupts(), and StartupProcSigHupHandler().
|
static |
Definition at line 60 of file startup.c.
Referenced by PostRestoreCommand(), PreRestoreCommand(), and StartupProcShutdownHandler().
int log_startup_progress_interval = 10000 |
Definition at line 76 of file startup.c.
Referenced by begin_startup_progress_phase(), disable_startup_progress_timeout(), and enable_startup_progress_timeout().
|
static |
Definition at line 54 of file startup.c.
Referenced by IsPromoteSignaled(), ResetPromoteSignaled(), and StartupProcTriggerHandler().
|
static |
Definition at line 53 of file startup.c.
Referenced by PreRestoreCommand(), ProcessStartupProcInterrupts(), and StartupProcShutdownHandler().
|
static |
Definition at line 65 of file startup.c.
Referenced by enable_startup_progress_timeout(), and has_startup_progress_timeout_expired().
|
static |
Definition at line 71 of file startup.c.
Referenced by disable_startup_progress_timeout(), has_startup_progress_timeout_expired(), and startup_progress_timeout_handler().