PostgreSQL Source Code
git master
|
#include "access/xlogdefs.h"
Go to the source code of this file.
Macros | |
#define | WalSndWakeupRequest() do { wake_wal_senders = true; } while (0) |
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 | PhysicalWakeupLogicalWalSnd (void) |
XLogRecPtr | GetStandbyFlushRecPtr (TimeLineID *tli) |
void | WalSndSignals (void) |
Size | WalSndShmemSize (void) |
void | WalSndShmemInit (void) |
void | WalSndWakeup (bool physical, bool logical) |
void | WalSndInitStopping (void) |
void | WalSndWaitStopping (void) |
void | HandleWalSndInitStopping (void) |
void | WalSndRqstFileReload (void) |
static void | WalSndWakeupProcessRequests (bool physical, bool logical) |
#define WalSndWakeupRequest | ( | ) | do { wake_wal_senders = true; } while (0) |
Definition at line 59 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 1980 of file walsender.c.
References ALLOCSET_DEFAULT_SIZES, AllocSetContextCreate, AlterReplicationSlot(), 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, uploaded_manifest, UploadManifest(), WalSndSetState(), WALSNDSTATE_STOPPING, and xlogreader.
Referenced by PostgresMain().
XLogRecPtr GetStandbyFlushRecPtr | ( | TimeLineID * | tli | ) |
Definition at line 3504 of file walsender.c.
References am_cascading_walsender, Assert, GetWalRcvFlushRecPtr(), GetXLogReplayRecPtr(), IsSyncingReplicationSlots(), and receiveTLI.
Referenced by IdentifySystem(), StartReplication(), synchronize_one_slot(), XLogSendLogical(), and XLogSendPhysical().
void HandleWalSndInitStopping | ( | void | ) |
Definition at line 3560 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 PhysicalWakeupLogicalWalSnd | ( | void | ) |
Definition at line 1736 of file walsender.c.
References Assert, ConditionVariableBroadcast(), ReplicationSlot::data, MyReplicationSlot, ReplicationSlotPersistentData::name, NameStr, RecoveryInProgress(), SlotExistsInSyncStandbySlots(), SlotIsPhysical, WalSndCtlData::wal_confirm_rcv_cv, and WalSndCtl.
Referenced by pg_physical_replication_slot_advance(), and PhysicalConfirmReceivedLocation().
void WalSndErrorCleanup | ( | void | ) |
Definition at line 327 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 3745 of file walsender.c.
References i, INVALID_PROC_NUMBER, 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 362 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(), UploadManifest(), and WalSndErrorCleanup().
void WalSndRqstFileReload | ( | void | ) |
Definition at line 3537 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 3621 of file walsender.c.
References ConditionVariableInit(), dlist_init(), i, max_wal_senders, MemSet, WalSnd::mutex, NUM_SYNC_REP_WAIT_MODE, ShmemInitStruct(), SpinLockInit, WalSndCtlData::SyncRepQueue, WalSndCtlData::wal_confirm_rcv_cv, WalSndCtlData::wal_flush_cv, WalSndCtlData::wal_replay_cv, WalSndCtl, WalSndCtlData::walsnds, and WalSndShmemSize().
Referenced by CreateOrAttachShmemStructs().
Size WalSndShmemSize | ( | void | ) |
Definition at line 3609 of file walsender.c.
References add_size(), max_wal_senders, mul_size(), and size.
Referenced by CalculateShmemSize(), and WalSndShmemInit().
void WalSndSignals | ( | void | ) |
Definition at line 3590 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 3771 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().
Definition at line 3666 of file walsender.c.
References ConditionVariableBroadcast(), WalSndCtlData::wal_flush_cv, WalSndCtlData::wal_replay_cv, and WalSndCtl.
Referenced by ApplyWalRecord(), KeepFileRestoredFromArchive(), StartupXLOG(), WalSndWakeupProcessRequests(), and XLogWalRcvFlush().
Definition at line 66 of file walsender.h.
References max_wal_senders, wake_wal_senders, and WalSndWakeup().
Referenced by XLogBackgroundFlush(), and XLogFlush().
|
extern |
Definition at line 116 of file walsender.c.
Referenced by GetStandbyFlushRecPtr(), IdentifySystem(), logical_read_xlog_page(), ProcessStandbyReplyMessage(), StartLogicalReplication(), StartReplication(), SyncRepGetStandbyPriority(), XLogSendLogical(), and XLogSendPhysical().
|
extern |
Definition at line 118 of file walsender.c.
Referenced by check_db(), ClientAuthentication(), InitPostgres(), and ProcessStartupPacket().
|
extern |
Definition at line 115 of file walsender.c.
Referenced by BackendInitialize(), check_db(), ClientAuthentication(), forbidden_in_wal_sender(), HandleWalSndInitStopping(), InitPostgres(), LagTrackerWrite(), MarkPostmasterChildWalSender(), PerformAuthentication(), PostgresMain(), ProcessStartupPacket(), ReplicationSlotAcquire(), ReplicationSlotRelease(), and WalSndSetState().
|
extern |
Definition at line 125 of file walsender.c.
Referenced by exec_replication_command(), ReplicationSlotAcquire(), and ReplicationSlotRelease().
|
extern |
Definition at line 121 of file walsender.c.
Referenced by CheckRequiredParameterValues(), InitControlFile(), InitializeMaxBackends(), InitProcess(), InitWalSenderSlot(), MaxLivePostmasterChildren(), pg_stat_get_wal_senders(), PostmasterMain(), SyncRepGetCandidateStandbys(), WalSndInitStopping(), WalSndRqstFileReload(), WalSndShmemInit(), WalSndShmemSize(), WalSndWaitStopping(), WalSndWakeupProcessRequests(), and XLogReportParameters().
|
extern |
Definition at line 130 of file walsender.c.
Referenced by WalSndWakeupProcessRequests().
|
extern |
Definition at line 123 of file walsender.c.
Referenced by WalSndCheckTimeOut(), WalSndComputeSleeptime(), WalSndKeepaliveIfNecessary(), WalSndUpdateProgress(), and WalSndWriteData().