summaryrefslogtreecommitdiff
path: root/src/include/pgxc
diff options
context:
space:
mode:
authorPavan Deolasee2016-02-08 09:57:40 +0000
committerPavan Deolasee2016-10-18 09:57:44 +0000
commitf5433defb4a6c8c309b42aae046036a4410aeaae (patch)
tree65c104808403f4f265341811de3de372a9289485 /src/include/pgxc
parent334e6aa8350615ccfbdaedebd28537ce5ea7b242 (diff)
Track PID of the remote backend processes serving a particular connection.
This information is usally readily available in PGConn, but since we only pass around socket descriptors between pooler and the coordinator (or datanode backends), we pass this information back to the backends. This is at least very useful for debugging purposes. (This API definitely deserves some refactoring. In particular, I would like to keep a copy of some other members of the PGConn structure in the PGXCNodeHandle, but for now backend PID is what we care for).
Diffstat (limited to 'src/include/pgxc')
-rw-r--r--src/include/pgxc/pgxcnode.h3
-rw-r--r--src/include/pgxc/poolmgr.h3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/include/pgxc/pgxcnode.h b/src/include/pgxc/pgxcnode.h
index 789d7cecbc..d57aabe18b 100644
--- a/src/include/pgxc/pgxcnode.h
+++ b/src/include/pgxc/pgxcnode.h
@@ -66,6 +66,9 @@ struct pgxc_node_handle
/* fd of the connection */
int sock;
+ /* pid of the remote backend process */
+ int backend_pid;
+
/* Connection state */
char transaction_status;
DNConnectionState state;
diff --git a/src/include/pgxc/poolmgr.h b/src/include/pgxc/poolmgr.h
index e9f5bbd189..2b8ad5dbef 100644
--- a/src/include/pgxc/poolmgr.h
+++ b/src/include/pgxc/poolmgr.h
@@ -117,7 +117,8 @@ extern char *session_options(void);
extern void PoolManagerReconnect(void);
/* Get pooled connections */
-extern int *PoolManagerGetConnections(List *datanodelist, List *coordlist);
+extern int *PoolManagerGetConnections(List *datanodelist, List *coordlist,
+ int **pids);
/* Clean pool connections */
extern void PoolManagerCleanConnection(List *datanodelist, List *coordlist, char *dbname, char *username);