PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
worker_internal.h
Go to the documentation of this file.
1 /*-------------------------------------------------------------------------
2  *
3  * worker_internal.h
4  * Internal headers shared by logical replication workers.
5  *
6  * Portions Copyright (c) 2016-2017, PostgreSQL Global Development Group
7  *
8  * src/include/replication/worker_internal.h
9  *
10  *-------------------------------------------------------------------------
11  */
12 #ifndef WORKER_INTERNAL_H
13 #define WORKER_INTERNAL_H
14 
15 #include "access/xlogdefs.h"
17 #include "datatype/timestamp.h"
18 #include "storage/lock.h"
19 
20 typedef struct LogicalRepWorker
21 {
22  /* Pointer to proc array. NULL if not running. */
24 
25  /* Database id to connect to. */
27 
28  /* User to use for connection (will be same as owner of subscription). */
30 
31  /* Subscription id for the worker. */
33 
34  /* Used for initial table synchronization. */
36 
37  /* Stats. */
44 
45 /* libpqreceiver connection */
46 extern struct WalReceiverConn *wrconn;
47 
48 /* Worker and subscription objects. */
51 
52 extern bool in_remote_transaction;
53 extern bool got_SIGTERM;
54 
55 extern void logicalrep_worker_attach(int slot);
57 extern int logicalrep_worker_count(Oid subid);
58 extern void logicalrep_worker_launch(Oid dbid, Oid subid, const char *subname, Oid userid);
59 extern void logicalrep_worker_stop(Oid subid);
60 extern void logicalrep_worker_wakeup(Oid subid);
61 
63 
64 #endif /* WORKER_INTERNAL_H */
LogicalRepWorker * logicalrep_worker_find(Oid subid)
Definition: launcher.c:204
Subscription * MySubscription
Definition: worker.c:108
TimestampTz last_send_time
XLogRecPtr last_lsn
void logicalrep_worker_sigterm(SIGNAL_ARGS)
Definition: launcher.c:457
struct LogicalRepWorker LogicalRepWorker
struct WalReceiverConn * wrconn
Definition: worker.c:106
unsigned int Oid
Definition: postgres_ext.h:31
void logicalrep_worker_stop(Oid subid)
Definition: launcher.c:313
double TimestampTz
Definition: timestamp.h:51
void logicalrep_worker_wakeup(Oid subid)
XLogRecPtr reply_lsn
int logicalrep_worker_count(Oid subid)
TimestampTz last_recv_time
#define SIGNAL_ARGS
Definition: c.h:1078
void logicalrep_worker_launch(Oid dbid, Oid subid, const char *subname, Oid userid)
Definition: launcher.c:228
uint64 XLogRecPtr
Definition: xlogdefs.h:21
bool in_remote_transaction
Definition: worker.c:111
void logicalrep_worker_attach(int slot)
Definition: launcher.c:407
Definition: proc.h:84
LogicalRepWorker * MyLogicalRepWorker
Definition: launcher.c:59
bool got_SIGTERM
Definition: launcher.c:75
TimestampTz reply_time