|
PostgreSQL Source Code git master
|
#include "postgres.h"#include <sys/stat.h>#include <sys/time.h>#include <unistd.h>#include <signal.h>#include "access/xlog_internal.h"#include "access/xlogrecovery.h"#include "pgstat.h"#include "replication/walreceiver.h"#include "storage/pmsignal.h"#include "storage/proc.h"#include "storage/shmem.h"#include "storage/subsystems.h"#include "utils/timestamp.h"#include "utils/wait_event.h"
Go to the source code of this file.
Macros | |
| #define | WALRCV_STARTUP_TIMEOUT 10 |
Functions | |
| static void | WalRcvShmemRequest (void *arg) |
| static void | WalRcvShmemInit (void *arg) |
| bool | WalRcvRunning (void) |
| WalRcvState | WalRcvGetState (void) |
| bool | WalRcvStreaming (void) |
| void | ShutdownWalRcv (void) |
| void | RequestXLogStreaming (TimeLineID tli, XLogRecPtr recptr, const char *conninfo, const char *slotname, bool create_temp_slot) |
| XLogRecPtr | GetWalRcvFlushRecPtr (XLogRecPtr *latestChunkStart, TimeLineID *receiveTLI) |
| XLogRecPtr | GetWalRcvWriteRecPtr (void) |
| int | GetReplicationApplyDelay (void) |
| int | GetReplicationTransferLatency (void) |
Variables | |
| WalRcvData * | WalRcv = NULL |
| const ShmemCallbacks | WalRcvShmemCallbacks |
| #define WALRCV_STARTUP_TIMEOUT 10 |
Definition at line 50 of file walreceiverfuncs.c.
Definition at line 381 of file walreceiverfuncs.c.
References fb(), GetCurrentChunkReplayStartTime(), GetCurrentTimestamp(), GetXLogReplayRecPtr(), SpinLockAcquire(), SpinLockRelease(), TimestampDifferenceMilliseconds(), and WalRcv.
Referenced by ProcessWalSndrMessage().
Definition at line 411 of file walreceiverfuncs.c.
References fb(), SpinLockAcquire(), SpinLockRelease(), TimestampDifferenceMilliseconds(), and WalRcv.
Referenced by ProcessWalSndrMessage().
| XLogRecPtr GetWalRcvFlushRecPtr | ( | XLogRecPtr * | latestChunkStart, |
| TimeLineID * | receiveTLI | ||
| ) |
Definition at line 348 of file walreceiverfuncs.c.
References fb(), receiveTLI, SpinLockAcquire(), SpinLockRelease(), and WalRcv.
Referenced by CreateRestartPoint(), GetCurrentLSNForWaitType(), GetLatestLSN(), GetStandbyFlushRecPtr(), pg_last_wal_receive_lsn(), and WaitForWALToBecomeAvailable().
| XLogRecPtr GetWalRcvWriteRecPtr | ( | void | ) |
Definition at line 369 of file walreceiverfuncs.c.
References fb(), pg_atomic_read_u64(), and WalRcv.
Referenced by GetCurrentLSNForWaitType().
| void RequestXLogStreaming | ( | TimeLineID | tli, |
| XLogRecPtr | recptr, | ||
| const char * | conninfo, | ||
| const char * | slotname, | ||
| bool | create_temp_slot | ||
| ) |
Definition at line 261 of file walreceiverfuncs.c.
References Assert, fb(), GetPGProcByNumber, INVALID_PROC_NUMBER, MAXCONNINFO, NAMEDATALEN, now(), pg_atomic_write_u64(), PMSIGNAL_START_WALRECEIVER, SendPostmasterSignal(), SetLatch(), SpinLockAcquire(), SpinLockRelease(), strlcpy(), wal_segment_size, WalRcv, WALRCV_RESTARTING, WALRCV_STARTING, WALRCV_STOPPED, WALRCV_WAITING, XLogRecPtrIsValid, and XLogSegmentOffset.
Referenced by WaitForWALToBecomeAvailable().
Definition at line 193 of file walreceiverfuncs.c.
References ConditionVariableBroadcast(), ConditionVariableCancelSleep(), ConditionVariablePrepareToSleep(), ConditionVariableSleep(), fb(), kill, pg_fallthrough, SpinLockAcquire(), SpinLockRelease(), WalRcv, WALRCV_CONNECTING, WALRCV_RESTARTING, WALRCV_STARTING, WALRCV_STOPPED, WALRCV_STOPPING, WALRCV_STREAMING, WALRCV_WAITING, and WalRcvRunning().
Referenced by XLogShutdownWalRcv().
| WalRcvState WalRcvGetState | ( | void | ) |
Definition at line 124 of file walreceiverfuncs.c.
References fb(), SpinLockAcquire(), SpinLockRelease(), and WalRcv.
Referenced by WaitForWALToBecomeAvailable().
Definition at line 76 of file walreceiverfuncs.c.
References ConditionVariableBroadcast(), fb(), now(), SpinLockAcquire(), SpinLockRelease(), WalRcv, WALRCV_STARTING, WALRCV_STARTUP_TIMEOUT, and WALRCV_STOPPED.
Referenced by ShutdownWalRcv(), and StartupRequestWalReceiverRestart().
Definition at line 64 of file walreceiverfuncs.c.
References ConditionVariableInit(), INVALID_PROC_NUMBER, MemSet, WalRcvData::mutex, pg_atomic_init_u64(), WalRcvData::procno, SpinLockInit(), WalRcv, WALRCV_STOPPED, WalRcvData::walRcvState, WalRcvData::walRcvStoppedCV, and WalRcvData::writtenUpto.
Definition at line 54 of file walreceiverfuncs.c.
References name, ShmemRequestStruct, and WalRcv.
Definition at line 141 of file walreceiverfuncs.c.
References ConditionVariableBroadcast(), fb(), now(), SpinLockAcquire(), SpinLockRelease(), WalRcv, WALRCV_CONNECTING, WALRCV_RESTARTING, WALRCV_STARTING, WALRCV_STARTUP_TIMEOUT, WALRCV_STOPPED, and WALRCV_STREAMING.
Referenced by FinishWalRecovery(), and WaitForWALToBecomeAvailable().
| WalRcvData* WalRcv = NULL |
Definition at line 36 of file walreceiverfuncs.c.
Referenced by GetReplicationApplyDelay(), GetReplicationTransferLatency(), GetWalRcvFlushRecPtr(), GetWalRcvWriteRecPtr(), pg_stat_get_wal_receiver(), ProcessWalSndrMessage(), RequestXLogStreaming(), ShutdownWalRcv(), WalRcvDie(), WalRcvGetState(), WalRcvRequestApplyReply(), WalRcvRunning(), WalRcvShmemInit(), WalRcvShmemRequest(), WalRcvStreaming(), WalRcvWaitForStartPosition(), WalReceiverMain(), XLogWalRcvFlush(), and XLogWalRcvWrite().
| const ShmemCallbacks WalRcvShmemCallbacks |
Definition at line 41 of file walreceiverfuncs.c.