#include <netdb.h>
#include "access/xlog.h"
#include "access/xlogdefs.h"
#include "pgtime.h"
#include "port/atomics.h"
#include "replication/logicalproto.h"
#include "replication/walsender.h"
#include "storage/condition_variable.h"
#include "storage/spin.h"
#include "utils/tuplestore.h"
Go to the source code of this file.
Definition at line 40 of file walreceiver.h.
Definition at line 37 of file walreceiver.h.
Definition at line 461 of file walreceiver.h.
Definition at line 437 of file walreceiver.h.
Definition at line 435 of file walreceiver.h.
Definition at line 459 of file walreceiver.h.
Definition at line 467 of file walreceiver.h.
Definition at line 453 of file walreceiver.h.
Definition at line 465 of file walreceiver.h.
Definition at line 463 of file walreceiver.h.
Definition at line 439 of file walreceiver.h.
Definition at line 445 of file walreceiver.h.
Definition at line 441 of file walreceiver.h.
Definition at line 443 of file walreceiver.h.
Definition at line 449 of file walreceiver.h.
Definition at line 455 of file walreceiver.h.
Definition at line 457 of file walreceiver.h.
Definition at line 447 of file walreceiver.h.
Definition at line 451 of file walreceiver.h.
Definition at line 379 of file walreceiver.h.
Definition at line 254 of file walreceiver.h.
Definition at line 242 of file walreceiver.h.
Definition at line 365 of file walreceiver.h.
Definition at line 410 of file walreceiver.h.
Definition at line 330 of file walreceiver.h.
Definition at line 400 of file walreceiver.h.
Definition at line 390 of file walreceiver.h.
Definition at line 263 of file walreceiver.h.
Definition at line 291 of file walreceiver.h.
Definition at line 272 of file walreceiver.h.
Definition at line 283 of file walreceiver.h.
Definition at line 307 of file walreceiver.h.
Definition at line 341 of file walreceiver.h.
Definition at line 351 of file walreceiver.h.
Definition at line 298 of file walreceiver.h.
Definition at line 321 of file walreceiver.h.
Definition at line 195 of file walreceiver.h.
Enumerator | |
---|---|
WALRCV_ERROR | |
WALRCV_OK_COMMAND | |
WALRCV_OK_TUPLES | |
WALRCV_OK_COPY_IN | |
WALRCV_OK_COPY_OUT | |
WALRCV_OK_COPY_BOTH |
Definition at line 202 of file walreceiver.h.
Enumerator | |
---|---|
WALRCV_STOPPED | |
WALRCV_STARTING | |
WALRCV_STREAMING | |
WALRCV_WAITING | |
WALRCV_RESTARTING | |
WALRCV_STOPPING |
Definition at line 45 of file walreceiver.h.
Definition at line 365 of file walreceiverfuncs.c.
References WalRcvData::flushedUpto, GetCurrentChunkReplayStartTime(), GetCurrentTimestamp(), GetXLogReplayRecPtr(), WalRcvData::mutex, SpinLockAcquire, SpinLockRelease, TimestampDifferenceMilliseconds(), and WalRcv.
Referenced by ProcessWalSndrMessage().
Definition at line 395 of file walreceiverfuncs.c.
References WalRcvData::lastMsgReceiptTime, WalRcvData::lastMsgSendTime, WalRcvData::mutex, SpinLockAcquire, SpinLockRelease, TimestampDifferenceMilliseconds(), and WalRcv.
Referenced by ProcessWalSndrMessage().
Definition at line 332 of file walreceiverfuncs.c.
References WalRcvData::flushedUpto, WalRcvData::latestChunkStart, WalRcvData::mutex, WalRcvData::receivedTLI, receiveTLI, SpinLockAcquire, SpinLockRelease, and WalRcv.
Referenced by CreateRestartPoint(), GetLatestLSN(), GetStandbyFlushRecPtr(), pg_last_wal_receive_lsn(), reserve_wal_for_local_slot(), and WaitForWALToBecomeAvailable().
Definition at line 353 of file walreceiverfuncs.c.
References pg_atomic_read_u64(), WalRcv, and WalRcvData::writtenUpto.
Definition at line 246 of file walreceiverfuncs.c.
References Assert(), WalRcvData::conninfo, WalRcvData::flushedUpto, GetPGProcByNumber, INVALID_PROC_NUMBER, WalRcvData::is_temp_slot, WalRcvData::latestChunkStart, MAXCONNINFO, WalRcvData::mutex, NAMEDATALEN, now(), PMSIGNAL_START_WALRECEIVER, WalRcvData::procno, WalRcvData::receivedTLI, WalRcvData::receiveStart, WalRcvData::receiveStartTLI, SendPostmasterSignal(), SetLatch(), WalRcvData::slotname, SpinLockAcquire, SpinLockRelease, WalRcvData::startTime, strlcpy(), wal_segment_size, WalRcv, WALRCV_RESTARTING, WALRCV_STARTING, WALRCV_STOPPED, WALRCV_WAITING, WalRcvData::walRcvState, and XLogSegmentOffset.
Referenced by WaitForWALToBecomeAvailable().
Definition at line 179 of file walreceiverfuncs.c.
References ConditionVariableBroadcast(), ConditionVariableCancelSleep(), ConditionVariablePrepareToSleep(), ConditionVariableSleep(), kill, WalRcvData::mutex, WalRcvData::pid, SpinLockAcquire, SpinLockRelease, WalRcv, WALRCV_RESTARTING, WALRCV_STARTING, WALRCV_STOPPED, WALRCV_STOPPING, WALRCV_STREAMING, WALRCV_WAITING, WalRcvRunning(), WalRcvData::walRcvState, and WalRcvData::walRcvStoppedCV.
Referenced by XLogShutdownWalRcv().
Definition at line 471 of file walreceiver.h.
References WalRcvExecResult::err, FreeTupleDesc(), pfree(), WalRcvExecResult::tupledesc, WalRcvExecResult::tuplestore, and tuplestore_end().
Referenced by check_pub_dead_tuple_retention(), check_publications(), check_publications_origin(), copy_table(), fetch_remote_table_info(), fetch_table_list(), LogicalRepSyncTableStart(), ReplicationSlotDropAtPubNode(), synchronize_slots(), and validate_remote_info().
Definition at line 1350 of file walreceiver.c.
References WalRcvData::force_reply, GetPGProcByNumber, INVALID_PROC_NUMBER, WalRcvData::mutex, WalRcvData::procno, SetLatch(), SpinLockAcquire, SpinLockRelease, and WalRcv.
Referenced by ApplyWalRecord(), and WaitForWALToBecomeAvailable().
Definition at line 76 of file walreceiverfuncs.c.
References ConditionVariableBroadcast(), WalRcvData::mutex, now(), SpinLockAcquire, SpinLockRelease, WalRcvData::startTime, WalRcv, WALRCV_STARTING, WALRCV_STARTUP_TIMEOUT, WALRCV_STOPPED, WalRcvData::walRcvState, and WalRcvData::walRcvStoppedCV.
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 127 of file walreceiverfuncs.c.
References ConditionVariableBroadcast(), WalRcvData::mutex, now(), SpinLockAcquire, SpinLockRelease, WalRcvData::startTime, WalRcv, WALRCV_RESTARTING, WALRCV_STARTING, WALRCV_STARTUP_TIMEOUT, WALRCV_STOPPED, WALRCV_STREAMING, WalRcvData::walRcvState, and WalRcvData::walRcvStoppedCV.
Referenced by FinishWalRecovery(), and WaitForWALToBecomeAvailable().
Definition at line 152 of file walreceiver.c.
References ARCHIVE_MODE_ALWAYS, Assert(), AuxiliaryProcessMainCommon(), B_WAL_RECEIVER, buf, CHECK_FOR_INTERRUPTS, close, cluster_name, ConditionVariableBroadcast(), ConfigReloadPending, WalRcvData::conninfo, DEBUG1, die, elog, ereport, err(), errcode(), errcode_for_file_access(), errdetail(), errmsg(), ERROR, FATAL, WalRcvData::force_reply, GetCurrentTimestamp(), GetSystemIdentifier(), GetXLogReplayRecPtr(), i, initStringInfo(), WalRcvData::is_temp_slot, WalRcvData::lastMsgReceiptTime, WalRcvData::lastMsgSendTime, WalRcvData::latestWalEndTime, len, load_file(), LOG, LogstreamResult, LSN_FORMAT_ARGS, MAXCONNINFO, MAXFNAMELEN, Min, WalRcvData::mutex, MyBackendType, MyLatch, MyProcNumber, MyProcPid, NAMEDATALEN, now(), NUM_WALRCV_WAKEUPS, on_shmem_exit(), options, PANIC, pfree(), pg_atomic_write_u64(), pg_memory_barrier, PGC_SIGHUP, PGINVALID_SOCKET, pgstat_report_wal(), WalRcvData::pid, PointerGetDatum(), pqsignal, proc_exit(), ProcessConfigFile(), WalRcvData::procno, procsignal_sigusr1_handler(), WalRcvData::ready_to_display, WalRcvData::receiveStart, WalRcvData::receiveStartTLI, RecoveryInProgress(), recvFile, recvFileTLI, recvSegNo, reply_message, ResetLatch(), WalRcvData::sender_host, WalRcvData::sender_port, SIGALRM, SIGCHLD, SIGHUP, SignalHandlerForConfigReload(), SIGPIPE, SIGUSR1, SIGUSR2, WalRcvData::slotname, snprintf, SpinLockAcquire, SpinLockRelease, strlcpy(), TIMESTAMP_INFINITY, TimestampDifferenceMilliseconds(), UINT64_FORMAT, UnBlockSig, WaitLatchOrSocket(), wakeup, wal_segment_size, WalRcv, walrcv_connect, walrcv_create_slot, walrcv_endstreaming, walrcv_get_backend_pid, walrcv_get_conninfo, walrcv_get_senderinfo, walrcv_identify_system, walrcv_receive, WALRCV_RESTARTING, WALRCV_STARTING, walrcv_startstreaming, WALRCV_STOPPED, WALRCV_STOPPING, WALRCV_STREAMING, WALRCV_WAITING, WALRCV_WAKEUP_PING, WALRCV_WAKEUP_TERMINATE, WalRcvComputeNextWakeup(), WalRcvDie(), WalRcvFetchTimeLineHistoryFiles(), WalRcvData::walRcvState, WalRcvData::walRcvStoppedCV, WalRcvWaitForStartPosition(), WalReceiverFunctions, WL_EXIT_ON_PM_DEATH, WL_LATCH_SET, WL_SOCKET_READABLE, WL_TIMEOUT, wrconn, WalRcvData::writtenUpto, XLogArchiveForceDone(), XLogArchiveMode, XLogArchiveNotify(), XLogFileName(), XLogWalRcvFlush(), XLogWalRcvProcessMsg(), XLogWalRcvSendHSFeedback(), and XLogWalRcvSendReply().
Definition at line 90 of file walreceiver.c.
Referenced by slotsync_reread_config(), ValidateSlotSyncParams(), WalRcvComputeNextWakeup(), and XLogWalRcvSendHSFeedback().
Definition at line 88 of file walreceiver.c.
Referenced by adjust_xid_advance_interval(), send_feedback(), WalRcvComputeNextWakeup(), XLogWalRcvSendHSFeedback(), and XLogWalRcvSendReply().
Definition at line 89 of file walreceiver.c.
Referenced by logicalrep_worker_launch(), LogicalRepApplyLoop(), and WalRcvComputeNextWakeup().
Definition at line 34 of file walreceiverfuncs.c.
Referenced by GetReplicationApplyDelay(), GetReplicationTransferLatency(), GetWalRcvFlushRecPtr(), GetWalRcvWriteRecPtr(), pg_stat_get_wal_receiver(), ProcessWalSndrMessage(), RequestXLogStreaming(), ShutdownWalRcv(), WalRcvDie(), WalRcvForceReply(), WalRcvRunning(), WalRcvShmemInit(), WalRcvStreaming(), WalRcvWaitForStartPosition(), WalReceiverMain(), XLogWalRcvFlush(), and XLogWalRcvWrite().
Definition at line 94 of file walreceiver.c.
Referenced by _PG_init(), and WalReceiverMain().