link::
Address of client connection the server is paired with.
+backend_pid::
+ Pid of backend server process. In case the server is another PgBouncer,
+ it will be a random number associated with this connection.
+
==== SHOW CLIENTS; ====
type::
link::
Address of server connection the client is paired with.
+backend_pid::
+ Random number sent to client as "backend process pid".
+ Usually unique, but not quaranteed.
+
==== SHOW POOLS; ====
A new pool entry is made for each couple of (database, user).
==== SHOW FDS; ====
-Shows list of fds in use. When the connected user has username
-"pgbouncer", connects through Unix socket and has same UID as running
-process, the actual fds are passed over the connection. This mechanism is
-used to do an online restart.
+Internal command - shows list of fds in use with internal state attached to them.
+
+When the connected user has username "pgbouncer", connects through Unix socket
+and has same UID as running process, the actual fds are passed over the connection.
+This mechanism is used to do an online restart.
Note: This does not work on Windows machines.
+This command also blocks internal event loop, so it should not be used
+while PgBouncer is in use.
+
fd::
File descriptor numeric value.
#include <usual/regex.h>
#include <usual/netdb.h>
+#include <usual/endian.h>
/* regex elements */
#define WS0 "[ \t\n\r]*"
return true;
}
-#define SKF_STD "sssssisiTTss"
-#define SKF_DBG "sssssisiTTssiiiiiii"
+#define SKF_STD "sssssisiTTssi"
+#define SKF_DBG "sssssisiTTssiiiiiiii"
static void socket_header(PktBuf *buf, bool debug)
{
"type", "user", "database", "state",
"addr", "port", "local_addr", "local_port",
"connect_time", "request_time",
- "ptr", "link",
+ "ptr", "link", "backend_pid",
"recv_pos", "pkt_pos", "pkt_remain",
"send_pos", "send_remain",
"pkt_avail", "send_avail");
static void socket_row(PktBuf *buf, PgSocket *sk, const char *state, bool debug)
{
int pkt_avail = 0, send_avail = 0;
+ int backend_pid;
char ptrbuf[128], linkbuf[128];
char l_addr[PGADDR_BUF], r_addr[PGADDR_BUF];
IOBuf *io = sk->sbuf.io;
else
linkbuf[0] = 0;
+ backend_pid = be32dec(sk->cancel_key);
+
pktbuf_write_DataRow(buf, debug ? SKF_DBG : SKF_STD,
is_server_socket(sk) ? "S" :"C",
sk->auth_user ? sk->auth_user->name : "(nouser)",
l_addr, pga_port(&sk->local_addr),
sk->connect_time,
sk->request_time,
- ptrbuf, linkbuf,
+ ptrbuf, linkbuf, backend_pid,
io ? io->recv_pos : 0,
io ? io->parse_pos : 0,
sk->sbuf.pkt_remain,