Re: Adding Unix domain socket path and port to pg_stat_get_wal_senders()

From: Euler Taveira <euler(at)timbira(dot)com(dot)br>
To: Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Adding Unix domain socket path and port to pg_stat_get_wal_senders()
Date: 2019-04-12 01:19:01
Message-ID: CAHE3wggExdKpBO_rzt8tYHGhpn22Ob2PJ4GG=+QSSmHYdFsgQQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em qui, 11 de abr de 2019 às 21:16, Tatsuo Ishii <ishii(at)sraoss(dot)co(dot)jp> escreveu:
>
> Currently pg_stat_replication view does not tell useful information
> regarding client connections if UNIX domain sockets are used for
> communication between sender and receiver. So it is not possible to
> tell which row corresponds to which standby server.
>
application_name. I'm not sure if it solves your complain but Peter
committed a patch [1] for v12 that distinguishes replicas in the same
host via cluster_name.

> test=# select client_addr, client_hostname, client_port,sync_state client_port from pg_stat_replication;
> client_addr | client_hostname | client_port | client_port
> -------------+-----------------+-------------+-------------
> | | -1 | async
> | | -1 | async
> (2 rows)
>
> This is due to that pg_stat_replication is created from
> pg_stat_get_activity view. pg_stat_get_activity view calls
> pg_stat_get_activity() which returns always NULL, NULL, -1 for
> client_add, client_hostname and client_port.
>
Socket has different semantic from TCP/UDP. We can't add socket
information into client_addr unless we are prepared to break this view
(client_addr has type inet and it would be necessary to change it to
text). It could break a lot of applications.

[1] https://www.postgresql.org/message-id/flat/1257eaee-4874-e791-e83a-46720c72cac7(at)2ndquadrant(dot)com

--
Euler Taveira Timbira -
http://www.timbira.com.br/
PostgreSQL: Consultoria, Desenvolvimento, Suporte 24x7 e Treinamento

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Langote 2019-04-12 01:48:06 Re: Issue in ExecCleanupTupleRouting()
Previous Message Kyotaro HORIGUCHI 2019-04-12 00:59:33 Re: finding changed blocks using WAL scanning