PostgreSQL Source Code
git master
|
#include <signal.h>
Go to the source code of this file.
Macros | |
#define | WalSndWakeupRequest() do { wake_wal_senders = true; } while (0) |
#define | WalSndWakeupProcessRequests() |
Enumerations | |
enum | CRSSnapshotAction { CRS_EXPORT_SNAPSHOT, CRS_NOEXPORT_SNAPSHOT, CRS_USE_SNAPSHOT } |
Functions | |
void | InitWalSender (void) |
bool | exec_replication_command (const char *query_string) |
void | WalSndErrorCleanup (void) |
void | WalSndResourceCleanup (bool isCommit) |
void | WalSndSignals (void) |
Size | WalSndShmemSize (void) |
void | WalSndShmemInit (void) |
void | WalSndWakeup (void) |
void | WalSndInitStopping (void) |
void | WalSndWaitStopping (void) |
void | HandleWalSndInitStopping (void) |
void | WalSndRqstFileReload (void) |
Variables | |
bool | am_walsender |
bool | am_cascading_walsender |
bool | am_db_walsender |
bool | wake_wal_senders |
int | max_wal_senders |
int | wal_sender_timeout |
bool | log_replication_commands |
#define WalSndWakeupProcessRequests | ( | ) |
Definition at line 63 of file walsender.h.
Referenced by XLogBackgroundFlush(), and XLogFlush().
#define WalSndWakeupRequest | ( | ) | do { wake_wal_senders = true; } while (0) |
Definition at line 57 of file walsender.h.
Referenced by XLogWrite().
enum CRSSnapshotAction |
Enumerator | |
---|---|
CRS_EXPORT_SNAPSHOT | |
CRS_NOEXPORT_SNAPSHOT | |
CRS_USE_SNAPSHOT |
Definition at line 20 of file walsender.h.
bool exec_replication_command | ( | const char * | query_string | ) |
Definition at line 1512 of file walsender.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, Assert, CHECK_FOR_INTERRUPTS, CommitTransactionCommand(), CreateDestReceiver(), CreateReplicationSlot(), CurrentMemoryContext, DEBUG1, debug_query_string, generate_unaccent_rules::dest, DestRemoteSimple, DropReplicationSlot(), elog, EndReplicationCommand(), ereport, errcode(), errmsg(), errmsg_internal(), ERROR, GetPGVariable(), got_STOPPING, IdentifySystem(), initStringInfo(), InvalidOid, IsA, IsAbortedTransactionBlockState(), StartReplicationCmd::kind, LOG, log_replication_commands, MemoryContextDelete(), MemoryContextSwitchTo(), MyDatabaseId, VariableShowStmt::name, pgstat_report_activity(), PreventInTransactionBlock(), REPLICATION_KIND_PHYSICAL, replication_parse_result, replication_scanner_finish(), replication_scanner_init(), replication_yyparse(), SendBaseBackup(), SendTimeLineHistory(), set_ps_display(), SnapBuildClearExportedSnapshot(), StartLogicalReplication(), StartReplication(), StartTransactionCommand(), WalSnd::state, STATE_RUNNING, T_BaseBackupCmd, T_CreateReplicationSlotCmd, T_DropReplicationSlotCmd, T_IdentifySystemCmd, T_StartReplicationCmd, T_TimeLineHistoryCmd, T_VariableShowStmt, TimeLineHistoryCmd::type, Node::type, WalSndSetState(), and WALSNDSTATE_STOPPING.
Referenced by PostgresMain().
void HandleWalSndInitStopping | ( | void | ) |
Definition at line 3011 of file walsender.c.
References am_walsender, Assert, got_STOPPING, kill, MyProcPid, and replication_active.
Referenced by procsignal_sigusr1_handler().
void InitWalSender | ( | void | ) |
Referenced by PostgresMain().
void WalSndErrorCleanup | ( | void | ) |
Definition at line 295 of file walsender.c.
References ConditionVariableCancelSleep(), got_SIGUSR2, got_STOPPING, IsTransactionOrTransactionBlock(), LWLockReleaseAll(), MyReplicationSlot, pgstat_report_wait_end(), proc_exit(), replication_active, ReplicationSlotCleanup(), ReplicationSlotRelease(), XLogReaderState::seg, wal_segment_close(), WalSndResourceCleanup(), WalSndSetState(), WALSNDSTATE_STARTUP, and WALOpenSegment::ws_file.
Referenced by PostgresMain().
void WalSndInitStopping | ( | void | ) |
Definition at line 3137 of file walsender.c.
References i, InvalidBackendId, max_wal_senders, WalSnd::mutex, WalSnd::pid, PROCSIG_WALSND_INIT_STOPPING, SendProcSignal(), SpinLockAcquire, SpinLockRelease, and WalSndCtlData::walsnds.
Referenced by ShutdownXLOG().
void WalSndResourceCleanup | ( | bool | isCommit | ) |
Definition at line 330 of file walsender.c.
References CurrentResourceOwner, DestNone, DestRemote, proc_exit(), RESOURCE_RELEASE_AFTER_LOCKS, RESOURCE_RELEASE_BEFORE_LOCKS, RESOURCE_RELEASE_LOCKS, ResourceOwnerDelete(), ResourceOwnerRelease(), WalSndShutdown(), and whereToSendOutput.
Referenced by perform_base_backup(), and WalSndErrorCleanup().
void WalSndRqstFileReload | ( | void | ) |
Definition at line 2988 of file walsender.c.
References i, max_wal_senders, WalSnd::mutex, WalSnd::needreload, WalSnd::pid, SpinLockAcquire, SpinLockRelease, and WalSndCtlData::walsnds.
Referenced by KeepFileRestoredFromArchive().
void WalSndShmemInit | ( | void | ) |
Definition at line 3076 of file walsender.c.
References i, max_wal_senders, MemSet, WalSnd::mutex, NUM_SYNC_REP_WAIT_MODE, ShmemInitStruct(), SHMQueueInit(), SpinLockInit, WalSndCtlData::SyncRepQueue, WalSndCtlData::walsnds, and WalSndShmemSize().
Referenced by CreateSharedMemoryAndSemaphores().
Size WalSndShmemSize | ( | void | ) |
Definition at line 3064 of file walsender.c.
References add_size(), max_wal_senders, mul_size(), and offsetof.
Referenced by CreateSharedMemoryAndSemaphores(), and WalSndShmemInit().
void WalSndSignals | ( | void | ) |
Definition at line 3045 of file walsender.c.
References die, InitializeTimeouts(), pqsignal(), procsignal_sigusr1_handler(), SIG_DFL, SIG_IGN, SIGCHLD, SIGHUP, SignalHandlerForConfigReload(), SIGPIPE, SIGUSR1, SIGUSR2, StatementCancelHandler(), and WalSndLastCycleHandler().
Referenced by PostgresMain().
void WalSndWaitStopping | ( | void | ) |
Definition at line 3163 of file walsender.c.
References i, max_wal_senders, WalSnd::mutex, pg_usleep(), WalSnd::pid, SpinLockAcquire, SpinLockRelease, WalSnd::state, WalSndCtlData::walsnds, and WALSNDSTATE_STOPPING.
Referenced by ShutdownXLOG().
void WalSndWakeup | ( | void | ) |
Definition at line 3108 of file walsender.c.
References i, WalSnd::latch, max_wal_senders, WalSnd::mutex, SetLatch(), SpinLockAcquire, SpinLockRelease, and WalSndCtlData::walsnds.
Referenced by KeepFileRestoredFromArchive(), StartupXLOG(), and XLogWalRcvFlush().
bool am_cascading_walsender |
Definition at line 116 of file walsender.c.
Referenced by IdentifySystem(), ProcessStandbyReplyMessage(), StartLogicalReplication(), StartReplication(), SyncRepGetStandbyPriority(), and XLogSendPhysical().
bool am_db_walsender |
Definition at line 118 of file walsender.c.
Referenced by check_db(), InitPostgres(), and ProcessStartupPacket().
bool am_walsender |
Definition at line 115 of file walsender.c.
Referenced by BackendInitialize(), check_db(), ClientAuthentication(), forbidden_in_wal_sender(), HandleWalSndInitStopping(), InitPostgres(), InitProcess(), LagTrackerWrite(), MarkPostmasterChildWalSender(), PerformAuthentication(), PostgresMain(), ProcessStartupPacket(), and WalSndSetState().
bool log_replication_commands |
Definition at line 125 of file walsender.c.
Referenced by exec_replication_command().
int max_wal_senders |
Definition at line 121 of file walsender.c.
Referenced by check_autovacuum_max_workers(), check_max_worker_processes(), check_maxconnections(), CheckRequiredParameterValues(), InitControlFile(), InitializeMaxBackends(), InitProcess(), InitWalSenderSlot(), MaxLivePostmasterChildren(), pg_stat_get_wal_senders(), PostmasterMain(), SyncRepGetCandidateStandbys(), WalSndInitStopping(), WalSndRqstFileReload(), WalSndShmemInit(), WalSndShmemSize(), WalSndWaitStopping(), WalSndWakeup(), and XLogReportParameters().
bool wake_wal_senders |
Definition at line 130 of file walsender.c.
int wal_sender_timeout |
Definition at line 123 of file walsender.c.
Referenced by WalSndCheckTimeOut(), WalSndComputeSleeptime(), WalSndKeepaliveIfNecessary(), and WalSndWriteData().