PostgreSQL Source Code git master
|
#include "storage/procnumber.h"
Go to the source code of this file.
Macros | |
#define | NUM_PROCSIGNALS (PROCSIG_RECOVERY_CONFLICT_LAST + 1) |
Typedefs | |
typedef struct ProcSignalHeader | ProcSignalHeader |
Enumerations | |
enum | ProcSignalReason { PROCSIG_CATCHUP_INTERRUPT , PROCSIG_NOTIFY_INTERRUPT , PROCSIG_PARALLEL_MESSAGE , PROCSIG_WALSND_INIT_STOPPING , PROCSIG_BARRIER , PROCSIG_LOG_MEMORY_CONTEXT , PROCSIG_PARALLEL_APPLY_MESSAGE , PROCSIG_RECOVERY_CONFLICT_FIRST , PROCSIG_RECOVERY_CONFLICT_DATABASE = PROCSIG_RECOVERY_CONFLICT_FIRST , PROCSIG_RECOVERY_CONFLICT_TABLESPACE , PROCSIG_RECOVERY_CONFLICT_LOCK , PROCSIG_RECOVERY_CONFLICT_SNAPSHOT , PROCSIG_RECOVERY_CONFLICT_LOGICALSLOT , PROCSIG_RECOVERY_CONFLICT_BUFFERPIN , PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK , PROCSIG_RECOVERY_CONFLICT_LAST = PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK } |
enum | ProcSignalBarrierType { PROCSIGNAL_BARRIER_SMGRRELEASE } |
Functions | |
Size | ProcSignalShmemSize (void) |
void | ProcSignalShmemInit (void) |
void | ProcSignalInit (bool cancel_key_valid, int32 cancel_key) |
int | SendProcSignal (pid_t pid, ProcSignalReason reason, ProcNumber procNumber) |
void | SendCancelRequest (int backendPID, int32 cancelAuthCode) |
uint64 | EmitProcSignalBarrier (ProcSignalBarrierType type) |
void | WaitForProcSignalBarrier (uint64 generation) |
void | ProcessProcSignalBarrier (void) |
void | procsignal_sigusr1_handler (SIGNAL_ARGS) |
#define NUM_PROCSIGNALS (PROCSIG_RECOVERY_CONFLICT_LAST + 1) |
Definition at line 52 of file procsignal.h.
typedef struct ProcSignalHeader ProcSignalHeader |
Definition at line 77 of file procsignal.h.
enum ProcSignalReason |
Definition at line 30 of file procsignal.h.
uint64 EmitProcSignalBarrier | ( | ProcSignalBarrierType | type | ) |
Definition at line 353 of file procsignal.c.
References i, kill, NumProcSignalSlots, pg_atomic_add_fetch_u64(), pg_atomic_fetch_or_u32(), pg_atomic_read_u32(), PROCSIG_BARRIER, ProcSignal, ProcSignalHeader::psh_barrierGeneration, ProcSignalHeader::psh_slot, ProcSignalSlot::pss_barrierCheckMask, ProcSignalSlot::pss_mutex, ProcSignalSlot::pss_pid, ProcSignalSlot::pss_signalFlags, SIGUSR1, SpinLockAcquire, SpinLockRelease, and type.
Referenced by dbase_redo(), dropdb(), DropTableSpace(), movedb(), and tblspc_redo().
void ProcessProcSignalBarrier | ( | void | ) |
Definition at line 496 of file procsignal.c.
References Assert, BARRIER_CLEAR_BIT, ConditionVariableBroadcast(), MyProcSignalSlot, pg_atomic_exchange_u32(), pg_atomic_read_u64(), pg_atomic_write_u64(), PG_CATCH, PG_END_TRY, PG_RE_THROW, pg_rightmost_one_pos32(), PG_TRY, ProcessBarrierSmgrRelease(), ProcSignal, PROCSIGNAL_BARRIER_SMGRRELEASE, ProcSignalBarrierPending, ProcSignalHeader::psh_barrierGeneration, ProcSignalSlot::pss_barrierCheckMask, ProcSignalSlot::pss_barrierCV, ProcSignalSlot::pss_barrierGeneration, ResetProcSignalBarrierBits(), success, and type.
Referenced by BufferSync(), CheckpointWriteDelay(), HandleAutoVacLauncherInterrupts(), HandleCheckpointerInterrupts(), HandleMainLoopInterrupts(), HandlePgArchInterrupts(), HandleStartupProcInterrupts(), HandleWalSummarizerInterrupts(), and ProcessInterrupts().
void procsignal_sigusr1_handler | ( | SIGNAL_ARGS | ) |
Definition at line 671 of file procsignal.c.
References CheckProcSignal(), HandleCatchupInterrupt(), HandleLogMemoryContextInterrupt(), HandleNotifyInterrupt(), HandleParallelApplyMessageInterrupt(), HandleParallelMessageInterrupt(), HandleProcSignalBarrierInterrupt(), HandleRecoveryConflictInterrupt(), HandleWalSndInitStopping(), MyLatch, PROCSIG_BARRIER, PROCSIG_CATCHUP_INTERRUPT, PROCSIG_LOG_MEMORY_CONTEXT, PROCSIG_NOTIFY_INTERRUPT, PROCSIG_PARALLEL_APPLY_MESSAGE, PROCSIG_PARALLEL_MESSAGE, PROCSIG_RECOVERY_CONFLICT_BUFFERPIN, PROCSIG_RECOVERY_CONFLICT_DATABASE, PROCSIG_RECOVERY_CONFLICT_LOCK, PROCSIG_RECOVERY_CONFLICT_LOGICALSLOT, PROCSIG_RECOVERY_CONFLICT_SNAPSHOT, PROCSIG_RECOVERY_CONFLICT_STARTUP_DEADLOCK, PROCSIG_RECOVERY_CONFLICT_TABLESPACE, PROCSIG_WALSND_INIT_STOPPING, and SetLatch().
Referenced by autoprewarm_main(), AutoVacWorkerMain(), BackgroundWorkerMain(), BackgroundWriterMain(), CheckpointerMain(), PgArchiverMain(), PostgresMain(), ReplSlotSyncWorkerMain(), StartupProcessMain(), WalReceiverMain(), WalSndSignals(), WalSummarizerMain(), and WalWriterMain().
void ProcSignalInit | ( | bool | cancel_key_valid, |
int32 | cancel_key | ||
) |
Definition at line 166 of file procsignal.c.
References CleanupProcSignalState(), elog, ERROR, LOG, MemSet, MyProcNumber, MyProcPid, MyProcSignalSlot, NUM_PROCSIGNALS, NumProcSignalSlots, on_shmem_exit(), pg_atomic_read_u32(), pg_atomic_read_u64(), pg_atomic_write_u32(), pg_atomic_write_u64(), ProcSignal, ProcSignalHeader::psh_barrierGeneration, ProcSignalHeader::psh_slot, ProcSignalSlot::pss_barrierCheckMask, ProcSignalSlot::pss_barrierGeneration, ProcSignalSlot::pss_cancel_key, ProcSignalSlot::pss_cancel_key_valid, ProcSignalSlot::pss_mutex, ProcSignalSlot::pss_pid, ProcSignalSlot::pss_signalFlags, SpinLockAcquire, and SpinLockRelease.
Referenced by AuxiliaryProcessMainCommon(), and InitPostgres().
void ProcSignalShmemInit | ( | void | ) |
Definition at line 130 of file procsignal.c.
References ConditionVariableInit(), i, MemSet, NumProcSignalSlots, pg_atomic_init_u32(), pg_atomic_init_u64(), PG_UINT64_MAX, ProcSignal, ProcSignalShmemSize(), ProcSignalHeader::psh_barrierGeneration, ProcSignalHeader::psh_slot, ProcSignalSlot::pss_barrierCheckMask, ProcSignalSlot::pss_barrierCV, ProcSignalSlot::pss_barrierGeneration, ProcSignalSlot::pss_cancel_key, ProcSignalSlot::pss_cancel_key_valid, ProcSignalSlot::pss_mutex, ProcSignalSlot::pss_pid, ProcSignalSlot::pss_signalFlags, ShmemInitStruct(), size, and SpinLockInit.
Referenced by CreateOrAttachShmemStructs().
Size ProcSignalShmemSize | ( | void | ) |
Definition at line 116 of file procsignal.c.
References add_size(), mul_size(), NumProcSignalSlots, and size.
Referenced by CalculateShmemSize(), and ProcSignalShmemInit().
void SendCancelRequest | ( | int | backendPID, |
int32 | cancelAuthCode | ||
) |
Definition at line 726 of file procsignal.c.
References Assert, DEBUG2, ereport, errmsg(), errmsg_internal(), i, kill, LOG, NumProcSignalSlots, pg_atomic_read_u32(), ProcSignal, ProcSignalHeader::psh_slot, ProcSignalSlot::pss_cancel_key, ProcSignalSlot::pss_cancel_key_valid, ProcSignalSlot::pss_mutex, ProcSignalSlot::pss_pid, SpinLockAcquire, and SpinLockRelease.
Referenced by ProcessStartupPacket().
int SendProcSignal | ( | pid_t | pid, |
ProcSignalReason | reason, | ||
ProcNumber | procNumber | ||
) |
Definition at line 281 of file procsignal.c.
References Assert, i, INVALID_PROC_NUMBER, kill, NumProcSignalSlots, pg_atomic_read_u32(), ProcSignal, ProcSignalHeader::psh_slot, ProcSignalSlot::pss_mutex, ProcSignalSlot::pss_pid, ProcSignalSlot::pss_signalFlags, SIGUSR1, SpinLockAcquire, and SpinLockRelease.
Referenced by CancelDBBackends(), InvalidatePossiblyObsoleteSlot(), mq_putmessage(), pa_shutdown(), ParallelWorkerShutdown(), pg_log_backend_memory_contexts(), SICleanupQueue(), SignalBackends(), SignalVirtualTransaction(), and WalSndInitStopping().
void WaitForProcSignalBarrier | ( | uint64 | generation | ) |
Definition at line 421 of file procsignal.c.
References Assert, ConditionVariableCancelSleep(), ConditionVariableTimedSleep(), DEBUG1, elog, ereport, errmsg(), i, LOG, NumProcSignalSlots, pg_atomic_read_u32(), pg_atomic_read_u64(), pg_memory_barrier, ProcSignal, ProcSignalHeader::psh_barrierGeneration, ProcSignalHeader::psh_slot, ProcSignalSlot::pss_barrierCV, ProcSignalSlot::pss_barrierGeneration, ProcSignalSlot::pss_pid, and UINT64_FORMAT.
Referenced by dbase_redo(), dropdb(), DropTableSpace(), movedb(), and tblspc_redo().