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 *cmd_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) |
#define WalSndWakeupProcessRequests | ( | ) |
Definition at line 63 of file walsender.h.
#define WalSndWakeupRequest | ( | ) | do { wake_wal_senders = true; } while (0) |
Definition at line 57 of file walsender.h.
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 * | cmd_string | ) |
Definition at line 1669 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, IsAbortedTransactionBlockState(), StartReplicationCmd::kind, LOG, log_replication_commands, MemoryContextDelete(), MemoryContextSwitchTo(), MyDatabaseId, MyWalSnd, VariableShowStmt::name, output_message, pgstat_report_activity(), PreventInTransactionBlock(), ReadReplicationSlot(), REPLICATION_KIND_PHYSICAL, replication_parse_result, replication_scanner_finish(), replication_scanner_init(), replication_scanner_is_replication_command(), replication_yyparse(), reply_message, SendBaseBackup(), SendTimeLineHistory(), set_ps_display(), SnapBuildClearExportedSnapshot(), StartLogicalReplication(), StartReplication(), StartTransactionCommand(), WalSnd::state, STATE_RUNNING, tmpbuf, Node::type, ReadReplicationSlotCmd::type, WalSndSetState(), WALSNDSTATE_STOPPING, and xlogreader.
Referenced by PostgresMain().
void HandleWalSndInitStopping | ( | void | ) |
Definition at line 3199 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 315 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, WALOpenSegment::ws_file, and xlogreader.
Referenced by PostgresMain().
void WalSndInitStopping | ( | void | ) |
Definition at line 3341 of file walsender.c.
References i, InvalidBackendId, max_wal_senders, WalSnd::mutex, WalSnd::pid, PROCSIG_WALSND_INIT_STOPPING, SendProcSignal(), SpinLockAcquire, SpinLockRelease, WalSndCtl, and WalSndCtlData::walsnds.
Referenced by ShutdownXLOG().
void WalSndResourceCleanup | ( | bool | isCommit | ) |
Definition at line 350 of file walsender.c.
References CurrentResourceOwner, RESOURCE_RELEASE_AFTER_LOCKS, RESOURCE_RELEASE_BEFORE_LOCKS, RESOURCE_RELEASE_LOCKS, ResourceOwnerDelete(), and ResourceOwnerRelease().
Referenced by perform_base_backup(), and WalSndErrorCleanup().
void WalSndRqstFileReload | ( | void | ) |
Definition at line 3176 of file walsender.c.
References i, max_wal_senders, WalSnd::mutex, WalSnd::needreload, WalSnd::pid, SpinLockAcquire, SpinLockRelease, WalSndCtl, and WalSndCtlData::walsnds.
Referenced by KeepFileRestoredFromArchive().
void WalSndShmemInit | ( | void | ) |
Definition at line 3264 of file walsender.c.
References dlist_init(), i, max_wal_senders, MemSet, WalSnd::mutex, NUM_SYNC_REP_WAIT_MODE, ShmemInitStruct(), SpinLockInit, WalSndCtlData::SyncRepQueue, WalSndCtl, WalSndCtlData::walsnds, and WalSndShmemSize().
Referenced by CreateSharedMemoryAndSemaphores().
Size WalSndShmemSize | ( | void | ) |
Definition at line 3252 of file walsender.c.
References add_size(), max_wal_senders, and mul_size().
Referenced by CalculateShmemSize(), and WalSndShmemInit().
void WalSndSignals | ( | void | ) |
Definition at line 3233 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 3367 of file walsender.c.
References i, max_wal_senders, WalSnd::mutex, pg_usleep(), WalSnd::pid, SpinLockAcquire, SpinLockRelease, WalSnd::state, WalSndCtl, WalSndCtlData::walsnds, and WALSNDSTATE_STOPPING.
Referenced by ShutdownXLOG().
void WalSndWakeup | ( | void | ) |
Definition at line 3296 of file walsender.c.
References i, WalSnd::latch, max_wal_senders, WalSnd::mutex, SetLatch(), SpinLockAcquire, SpinLockRelease, WalSndCtl, and WalSndCtlData::walsnds.
Referenced by ApplyWalRecord(), KeepFileRestoredFromArchive(), StartupXLOG(), and XLogWalRcvFlush().
|
extern |
Definition at line 117 of file walsender.c.
Referenced by IdentifySystem(), ProcessStandbyReplyMessage(), StartLogicalReplication(), StartReplication(), SyncRepGetStandbyPriority(), and XLogSendPhysical().
|
extern |
Definition at line 119 of file walsender.c.
Referenced by check_db(), ClientAuthentication(), InitPostgres(), and ProcessStartupPacket().
|
extern |
Definition at line 116 of file walsender.c.
Referenced by BackendInitialize(), check_db(), ClientAuthentication(), forbidden_in_wal_sender(), HandleWalSndInitStopping(), InitPostgres(), InitProcess(), LagTrackerWrite(), MarkPostmasterChildWalSender(), PerformAuthentication(), PostgresMain(), ProcessStartupPacket(), and WalSndSetState().
|
extern |
Definition at line 126 of file walsender.c.
Referenced by exec_replication_command().
|
extern |
Definition at line 122 of file walsender.c.
Referenced by check_autovacuum_max_workers(), check_max_connections(), check_max_worker_processes(), CheckRequiredParameterValues(), InitControlFile(), InitializeMaxBackends(), InitProcess(), InitWalSenderSlot(), MaxLivePostmasterChildren(), pg_stat_get_wal_senders(), PostmasterMain(), SyncRepGetCandidateStandbys(), WalSndInitStopping(), WalSndRqstFileReload(), WalSndShmemInit(), WalSndShmemSize(), WalSndWaitStopping(), WalSndWakeup(), and XLogReportParameters().
|
extern |
Definition at line 131 of file walsender.c.
|
extern |
Definition at line 124 of file walsender.c.
Referenced by WalSndCheckTimeOut(), WalSndComputeSleeptime(), WalSndKeepaliveIfNecessary(), WalSndUpdateProgress(), and WalSndWriteData().