diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2019-02-08 08:17:21 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2019-02-27 10:59:25 +0100 |
commit | 6ae578a91e653ce3f4cba8cab96ce41e0cc7103f (patch) | |
tree | 6b72d6f6e587f82ebbe2dcf4aecb39181146a9b7 /src | |
parent | 414a9d3cf34c7aff1c63533df4c40ebb63bd0840 (diff) |
Set fallback_application_name for a walreceiver to cluster_name
By default, the fallback_application_name for a physical walreceiver
is "walreceiver". This means that multiple standbys cannot be
distinguished easily on a primary, for example in pg_stat_activity or
synchronous_standby_names.
If cluster_name is set, use that for fallback_application_name in the
walreceiver. (If it's not set, it remains "walreceiver".) If someone
set cluster_name to identify their instance, we might as well use that
by default to identify the node remotely as well. It's still possible
to specify another application_name in primary_conninfo explicitly.
Reviewed-by: Euler Taveira <euler@timbira.com.br>
Discussion: https://www.postgresql.org/message-id/flat/1257eaee-4874-e791-e83a-46720c72cac7@2ndquadrant.com
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/replication/walreceiver.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/replication/walreceiver.c b/src/backend/replication/walreceiver.c index 2e90944ad52..9eaaa8ff505 100644 --- a/src/backend/replication/walreceiver.c +++ b/src/backend/replication/walreceiver.c @@ -293,7 +293,7 @@ WalReceiverMain(void) /* Establish the connection to the primary for XLOG streaming */ EnableWalRcvImmediateExit(); - wrconn = walrcv_connect(conninfo, false, "walreceiver", &err); + wrconn = walrcv_connect(conninfo, false, cluster_name[0] ? cluster_name : "walreceiver", &err); if (!wrconn) ereport(ERROR, (errmsg("could not connect to the primary server: %s", err))); |