37#define MAXCONNINFO 1024
40#define AllowCascadeReplication() (EnableHotStandby && max_wal_senders > 0)
129 char sender_host[NI_MAXHOST];
245 bool must_use_password,
255 bool must_use_password);
291typedef char *(*walrcv_get_dbname_from_conninfo_fn) (
const char *conninfo);
366 const char *slotname,
380 const char *slotname,
381 const bool *failover,
403 const Oid *retTypes);
435#define walrcv_connect(conninfo, replication, logical, must_use_password, appname, err) \
436 WalReceiverFunctions->walrcv_connect(conninfo, replication, logical, must_use_password, appname, err)
437#define walrcv_check_conninfo(conninfo, must_use_password) \
438 WalReceiverFunctions->walrcv_check_conninfo(conninfo, must_use_password)
439#define walrcv_get_conninfo(conn) \
440 WalReceiverFunctions->walrcv_get_conninfo(conn)
441#define walrcv_get_senderinfo(conn, sender_host, sender_port) \
442 WalReceiverFunctions->walrcv_get_senderinfo(conn, sender_host, sender_port)
443#define walrcv_identify_system(conn, primary_tli) \
444 WalReceiverFunctions->walrcv_identify_system(conn, primary_tli)
445#define walrcv_get_dbname_from_conninfo(conninfo) \
446 WalReceiverFunctions->walrcv_get_dbname_from_conninfo(conninfo)
447#define walrcv_server_version(conn) \
448 WalReceiverFunctions->walrcv_server_version(conn)
449#define walrcv_readtimelinehistoryfile(conn, tli, filename, content, size) \
450 WalReceiverFunctions->walrcv_readtimelinehistoryfile(conn, tli, filename, content, size)
451#define walrcv_startstreaming(conn, options) \
452 WalReceiverFunctions->walrcv_startstreaming(conn, options)
453#define walrcv_endstreaming(conn, next_tli) \
454 WalReceiverFunctions->walrcv_endstreaming(conn, next_tli)
455#define walrcv_receive(conn, buffer, wait_fd) \
456 WalReceiverFunctions->walrcv_receive(conn, buffer, wait_fd)
457#define walrcv_send(conn, buffer, nbytes) \
458 WalReceiverFunctions->walrcv_send(conn, buffer, nbytes)
459#define walrcv_create_slot(conn, slotname, temporary, two_phase, failover, snapshot_action, lsn) \
460 WalReceiverFunctions->walrcv_create_slot(conn, slotname, temporary, two_phase, failover, snapshot_action, lsn)
461#define walrcv_alter_slot(conn, slotname, failover, two_phase) \
462 WalReceiverFunctions->walrcv_alter_slot(conn, slotname, failover, two_phase)
463#define walrcv_get_backend_pid(conn) \
464 WalReceiverFunctions->walrcv_get_backend_pid(conn)
465#define walrcv_exec(conn, exec, nRetTypes, retTypes) \
466 WalReceiverFunctions->walrcv_exec(conn, exec, nRetTypes, retTypes)
467#define walrcv_disconnect(conn) \
468 WalReceiverFunctions->walrcv_disconnect(conn)
500 const char *conninfo,
const char *slotname,
501 bool create_temp_slot);
#define pg_attribute_noreturn()
void err(int eval, const char *fmt,...)
void pfree(void *pointer)
static pg_noinline void Size size
TimestampTz lastMsgReceiptTime
TimeLineID receiveStartTLI
XLogRecPtr latestChunkStart
ConditionVariable walRcvStoppedCV
pg_atomic_uint64 writtenUpto
TimestampTz lastMsgSendTime
TimestampTz latestWalEndTime
Tuplestorestate * tuplestore
walrcv_identify_system_fn walrcv_identify_system
walrcv_receive_fn walrcv_receive
walrcv_server_version_fn walrcv_server_version
walrcv_disconnect_fn walrcv_disconnect
walrcv_get_backend_pid_fn walrcv_get_backend_pid
walrcv_connect_fn walrcv_connect
walrcv_get_dbname_from_conninfo_fn walrcv_get_dbname_from_conninfo
walrcv_get_senderinfo_fn walrcv_get_senderinfo
walrcv_check_conninfo_fn walrcv_check_conninfo
walrcv_send_fn walrcv_send
walrcv_get_conninfo_fn walrcv_get_conninfo
walrcv_exec_fn walrcv_exec
walrcv_startstreaming_fn walrcv_startstreaming
walrcv_create_slot_fn walrcv_create_slot
walrcv_readtimelinehistoryfile_fn walrcv_readtimelinehistoryfile
walrcv_alter_slot_fn walrcv_alter_slot
walrcv_endstreaming_fn walrcv_endstreaming
void FreeTupleDesc(TupleDesc tupdesc)
void tuplestore_end(Tuplestorestate *state)
void ProcessWalRcvInterrupts(void)
XLogRecPtr GetWalRcvFlushRecPtr(XLogRecPtr *latestChunkStart, TimeLineID *receiveTLI)
void(* walrcv_endstreaming_fn)(WalReceiverConn *conn, TimeLineID *next_tli)
bool WalRcvStreaming(void)
struct WalRcvExecResult WalRcvExecResult
char *(* walrcv_get_dbname_from_conninfo_fn)(const char *conninfo)
void(* walrcv_send_fn)(WalReceiverConn *conn, const char *buffer, int nbytes)
void RequestXLogStreaming(TimeLineID tli, XLogRecPtr recptr, const char *conninfo, const char *slotname, bool create_temp_slot)
PGDLLIMPORT int wal_receiver_status_interval
char *(* walrcv_create_slot_fn)(WalReceiverConn *conn, const char *slotname, bool temporary, bool two_phase, bool failover, CRSSnapshotAction snapshot_action, XLogRecPtr *lsn)
WalReceiverConn *(* walrcv_connect_fn)(const char *conninfo, bool replication, bool logical, bool must_use_password, const char *appname, char **err)
pid_t(* walrcv_get_backend_pid_fn)(WalReceiverConn *conn)
void WalReceiverMain(char *startup_data, size_t startup_data_len) pg_attribute_noreturn()
XLogRecPtr GetWalRcvWriteRecPtr(void)
void ShutdownWalRcv(void)
bool(* walrcv_startstreaming_fn)(WalReceiverConn *conn, const WalRcvStreamOptions *options)
int(* walrcv_receive_fn)(WalReceiverConn *conn, char **buffer, pgsocket *wait_fd)
void(* walrcv_readtimelinehistoryfile_fn)(WalReceiverConn *conn, TimeLineID tli, char **filename, char **content, int *size)
WalRcvExecResult *(* walrcv_exec_fn)(WalReceiverConn *conn, const char *query, const int nRetTypes, const Oid *retTypes)
PGDLLIMPORT int wal_receiver_timeout
static void walrcv_clear_result(WalRcvExecResult *walres)
void(* walrcv_check_conninfo_fn)(const char *conninfo, bool must_use_password)
PGDLLIMPORT WalReceiverFunctionsType * WalReceiverFunctions
void(* walrcv_disconnect_fn)(WalReceiverConn *conn)
struct WalReceiverFunctionsType WalReceiverFunctionsType
char *(* walrcv_identify_system_fn)(WalReceiverConn *conn, TimeLineID *primary_tli)
void(* walrcv_get_senderinfo_fn)(WalReceiverConn *conn, char **sender_host, int *sender_port)
int GetReplicationApplyDelay(void)
PGDLLIMPORT WalRcvData * WalRcv
void WalRcvShmemInit(void)
char *(* walrcv_get_conninfo_fn)(WalReceiverConn *conn)
Size WalRcvShmemSize(void)
void(* walrcv_alter_slot_fn)(WalReceiverConn *conn, const char *slotname, const bool *failover, const bool *two_phase)
PGDLLIMPORT bool hot_standby_feedback
int(* walrcv_server_version_fn)(WalReceiverConn *conn)
void WalRcvForceReply(void)
int GetReplicationTransferLatency(void)
static TimeLineID receiveTLI