/src/postgres/src/include/replication/walsender.h
Line | Count | Source |
1 | | /*------------------------------------------------------------------------- |
2 | | * |
3 | | * walsender.h |
4 | | * Exports from replication/walsender.c. |
5 | | * |
6 | | * Portions Copyright (c) 2010-2026, PostgreSQL Global Development Group |
7 | | * |
8 | | * src/include/replication/walsender.h |
9 | | * |
10 | | *------------------------------------------------------------------------- |
11 | | */ |
12 | | #ifndef _WALSENDER_H |
13 | | #define _WALSENDER_H |
14 | | |
15 | | #include "access/xlogdefs.h" |
16 | | |
17 | | /* |
18 | | * What to do with a snapshot in create replication slot command. |
19 | | */ |
20 | | typedef enum |
21 | | { |
22 | | CRS_EXPORT_SNAPSHOT, |
23 | | CRS_NOEXPORT_SNAPSHOT, |
24 | | CRS_USE_SNAPSHOT, |
25 | | } CRSSnapshotAction; |
26 | | |
27 | | /* global state */ |
28 | | extern PGDLLIMPORT bool am_walsender; |
29 | | extern PGDLLIMPORT bool am_cascading_walsender; |
30 | | extern PGDLLIMPORT bool am_db_walsender; |
31 | | extern PGDLLIMPORT bool wake_wal_senders; |
32 | | |
33 | | /* user-settable parameters */ |
34 | | extern PGDLLIMPORT int max_wal_senders; |
35 | | extern PGDLLIMPORT int wal_sender_timeout; |
36 | | extern PGDLLIMPORT int wal_sender_shutdown_timeout; |
37 | | extern PGDLLIMPORT bool log_replication_commands; |
38 | | |
39 | | extern void InitWalSender(void); |
40 | | extern bool exec_replication_command(const char *cmd_string); |
41 | | extern void WalSndErrorCleanup(void); |
42 | | extern void PhysicalWakeupLogicalWalSnd(void); |
43 | | extern XLogRecPtr GetStandbyFlushRecPtr(TimeLineID *tli); |
44 | | extern void WalSndSignals(void); |
45 | | extern void WalSndWakeup(bool physical, bool logical); |
46 | | extern void WalSndInitStopping(void); |
47 | | extern void WalSndWaitStopping(void); |
48 | | extern void HandleWalSndInitStopping(void); |
49 | | extern void WalSndRqstFileReload(void); |
50 | | |
51 | | /* |
52 | | * Remember that we want to wakeup walsenders later |
53 | | * |
54 | | * This is separated from doing the actual wakeup because the writeout is done |
55 | | * while holding contended locks. |
56 | | */ |
57 | | #define WalSndWakeupRequest() \ |
58 | 0 | do { wake_wal_senders = true; } while (0) |
59 | | |
60 | | /* |
61 | | * wakeup walsenders if there is work to be done |
62 | | */ |
63 | | static inline void |
64 | | WalSndWakeupProcessRequests(bool physical, bool logical) |
65 | 0 | { |
66 | 0 | if (wake_wal_senders) |
67 | 0 | { |
68 | 0 | wake_wal_senders = false; |
69 | 0 | if (max_wal_senders > 0) |
70 | 0 | WalSndWakeup(physical, logical); |
71 | 0 | } |
72 | 0 | } Unexecuted instantiation: rewriteheap.c:WalSndWakeupProcessRequests Unexecuted instantiation: rmgr.c:WalSndWakeupProcessRequests Unexecuted instantiation: xact.c:WalSndWakeupProcessRequests Unexecuted instantiation: xlog.c:WalSndWakeupProcessRequests Unexecuted instantiation: xlogarchive.c:WalSndWakeupProcessRequests Unexecuted instantiation: xlogfuncs.c:WalSndWakeupProcessRequests Unexecuted instantiation: xlogrecovery.c:WalSndWakeupProcessRequests Unexecuted instantiation: xlogwait.c:WalSndWakeupProcessRequests Unexecuted instantiation: dbcommands.c:WalSndWakeupProcessRequests Unexecuted instantiation: repack.c:WalSndWakeupProcessRequests Unexecuted instantiation: repack_worker.c:WalSndWakeupProcessRequests Unexecuted instantiation: subscriptioncmds.c:WalSndWakeupProcessRequests Unexecuted instantiation: auth.c:WalSndWakeupProcessRequests Unexecuted instantiation: hba.c:WalSndWakeupProcessRequests Unexecuted instantiation: launch_backend.c:WalSndWakeupProcessRequests Unexecuted instantiation: pmchild.c:WalSndWakeupProcessRequests Unexecuted instantiation: postmaster.c:WalSndWakeupProcessRequests Unexecuted instantiation: walsummarizer.c:WalSndWakeupProcessRequests Unexecuted instantiation: applyparallelworker.c:WalSndWakeupProcessRequests Unexecuted instantiation: conflict.c:WalSndWakeupProcessRequests Unexecuted instantiation: decode.c:WalSndWakeupProcessRequests Unexecuted instantiation: launcher.c:WalSndWakeupProcessRequests Unexecuted instantiation: logical.c:WalSndWakeupProcessRequests Unexecuted instantiation: logicalctl.c:WalSndWakeupProcessRequests Unexecuted instantiation: logicalfuncs.c:WalSndWakeupProcessRequests Unexecuted instantiation: origin.c:WalSndWakeupProcessRequests Unexecuted instantiation: relation.c:WalSndWakeupProcessRequests Unexecuted instantiation: reorderbuffer.c:WalSndWakeupProcessRequests Unexecuted instantiation: sequencesync.c:WalSndWakeupProcessRequests Unexecuted instantiation: slotsync.c:WalSndWakeupProcessRequests Unexecuted instantiation: snapbuild.c:WalSndWakeupProcessRequests Unexecuted instantiation: syncutils.c:WalSndWakeupProcessRequests Unexecuted instantiation: tablesync.c:WalSndWakeupProcessRequests Unexecuted instantiation: worker.c:WalSndWakeupProcessRequests Unexecuted instantiation: repl_gram.c:WalSndWakeupProcessRequests Unexecuted instantiation: slot.c:WalSndWakeupProcessRequests Unexecuted instantiation: slotfuncs.c:WalSndWakeupProcessRequests Unexecuted instantiation: syncrep.c:WalSndWakeupProcessRequests Unexecuted instantiation: walreceiver.c:WalSndWakeupProcessRequests Unexecuted instantiation: walreceiverfuncs.c:WalSndWakeupProcessRequests Unexecuted instantiation: walsender.c:WalSndWakeupProcessRequests Unexecuted instantiation: basebackup.c:WalSndWakeupProcessRequests Unexecuted instantiation: pmsignal.c:WalSndWakeupProcessRequests Unexecuted instantiation: procsignal.c:WalSndWakeupProcessRequests Unexecuted instantiation: standby.c:WalSndWakeupProcessRequests Unexecuted instantiation: proc.c:WalSndWakeupProcessRequests Unexecuted instantiation: backend_startup.c:WalSndWakeupProcessRequests Unexecuted instantiation: postgres.c:WalSndWakeupProcessRequests Unexecuted instantiation: pgstat_replslot.c:WalSndWakeupProcessRequests Unexecuted instantiation: pgstat_subscription.c:WalSndWakeupProcessRequests Unexecuted instantiation: genfile.c:WalSndWakeupProcessRequests Unexecuted instantiation: pg_upgrade_support.c:WalSndWakeupProcessRequests Unexecuted instantiation: miscinit.c:WalSndWakeupProcessRequests Unexecuted instantiation: postinit.c:WalSndWakeupProcessRequests Unexecuted instantiation: guc_tables.c:WalSndWakeupProcessRequests |
73 | | |
74 | | #endif /* _WALSENDER_H */ |