PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
walsender.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * walsender.h
4  * Exports from replication/walsender.c.
5  *
6  * Portions Copyright (c) 2010-2017, 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 <signal.h>
16 
17 #include "fmgr.h"
18 
19 /* global state */
20 extern bool am_walsender;
21 extern bool am_cascading_walsender;
22 extern bool am_db_walsender;
23 extern bool wake_wal_senders;
24 
25 /* user-settable parameters */
26 extern int max_wal_senders;
27 extern int wal_sender_timeout;
28 extern bool log_replication_commands;
29 
30 extern void InitWalSender(void);
31 extern void exec_replication_command(const char *query_string);
32 extern void WalSndErrorCleanup(void);
33 extern void WalSndSignals(void);
34 extern Size WalSndShmemSize(void);
35 extern void WalSndShmemInit(void);
36 extern void WalSndWakeup(void);
37 extern void WalSndRqstFileReload(void);
38 
39 /*
40  * Remember that we want to wakeup walsenders later
41  *
42  * This is separated from doing the actual wakeup because the writeout is done
43  * while holding contended locks.
44  */
45 #define WalSndWakeupRequest() \
46  do { wake_wal_senders = true; } while (0)
47 
48 /*
49  * wakeup walsenders if there is work to be done
50  */
51 #define WalSndWakeupProcessRequests() \
52  do \
53  { \
54  if (wake_wal_senders) \
55  { \
56  wake_wal_senders = false; \
57  if (max_wal_senders > 0) \
58  WalSndWakeup(); \
59  } \
60  } while (0)
61 
62 #endif /* _WALSENDER_H */
void WalSndSignals(void)
Definition: walsender.c:2564
bool log_replication_commands
Definition: walsender.c:115
void WalSndRqstFileReload(void)
Definition: walsender.c:2500
bool am_db_walsender
Definition: walsender.c:109
int max_wal_senders
Definition: walsender.c:112
bool am_cascading_walsender
Definition: walsender.c:107
void exec_replication_command(const char *query_string)
Definition: walsender.c:1223
int wal_sender_timeout
Definition: walsender.c:113
void InitWalSender(void)
void WalSndShmemInit(void)
Definition: walsender.c:2600
bool wake_wal_senders
Definition: walsender.c:120
void WalSndWakeup(void)
Definition: walsender.c:2632
size_t Size
Definition: c.h:352
Size WalSndShmemSize(void)
Definition: walsender.c:2588
void WalSndErrorCleanup(void)
Definition: walsender.c:257
bool am_walsender
Definition: walsender.c:106