|
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 "utils/timestamp.h"
Go to the source code of this file.
Macros | |
| #define | WALRCV_STARTUP_TIMEOUT 10 |
Functions | |
| Size | WalRcvShmemSize (void) |
| void | WalRcvShmemInit (void) |
| 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 |
| #define WALRCV_STARTUP_TIMEOUT 10 |
Definition at line 40 of file walreceiverfuncs.c.
Definition at line 380 of file walreceiverfuncs.c.
References fb(), GetCurrentChunkReplayStartTime(), GetCurrentTimestamp(), GetXLogReplayRecPtr(), SpinLockAcquire, SpinLockRelease, TimestampDifferenceMilliseconds(), and WalRcv.
Referenced by ProcessWalSndrMessage().
Definition at line 410 of file walreceiverfuncs.c.
References fb(), SpinLockAcquire, SpinLockRelease, TimestampDifferenceMilliseconds(), and WalRcv.
Referenced by ProcessWalSndrMessage().
| XLogRecPtr GetWalRcvFlushRecPtr | ( | XLogRecPtr * | latestChunkStart, |
| TimeLineID * | receiveTLI | ||
| ) |
Definition at line 347 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 368 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(), 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, 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 55 of file walreceiverfuncs.c.
References ConditionVariableInit(), INVALID_PROC_NUMBER, MemSet, WalRcvData::mutex, pg_atomic_init_u64(), WalRcvData::procno, ShmemInitStruct(), SpinLockInit, WalRcv, WALRCV_STOPPED, WalRcvShmemSize(), WalRcvData::walRcvState, WalRcvData::walRcvStoppedCV, and WalRcvData::writtenUpto.
Referenced by CreateOrAttachShmemStructs().
Definition at line 44 of file walreceiverfuncs.c.
References add_size().
Referenced by CalculateShmemSize(), and WalRcvShmemInit().
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 34 of file walreceiverfuncs.c.
Referenced by GetReplicationApplyDelay(), GetReplicationTransferLatency(), GetWalRcvFlushRecPtr(), GetWalRcvWriteRecPtr(), pg_stat_get_wal_receiver(), ProcessWalSndrMessage(), RequestXLogStreaming(), ShutdownWalRcv(), WalRcvDie(), WalRcvForceReply(), WalRcvGetState(), WalRcvRunning(), WalRcvShmemInit(), WalRcvStreaming(), WalRcvWaitForStartPosition(), WalReceiverMain(), XLogWalRcvFlush(), and XLogWalRcvWrite().