mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
Add connection messages for streaming replication. log_connections
was broken for a replication connection and no messages were displayed on either standby or primary, at any debug level. Connection messages needed to diagnose session drop/reconnect events. Use LOG mode for now, discuss lowering in later releases.
This commit is contained in:
parent
75867c528d
commit
6a771d1d36
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c,v 1.6 2010/03/19 17:51:42 sriggs Exp $
|
* $PostgreSQL: pgsql/src/backend/replication/libpqwalreceiver/libpqwalreceiver.c,v 1.7 2010/03/19 19:19:38 sriggs Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -157,6 +157,8 @@ libpqrcv_connect(char *conninfo, XLogRecPtr startpoint)
|
|||||||
PQclear(res);
|
PQclear(res);
|
||||||
|
|
||||||
justconnected = true;
|
justconnected = true;
|
||||||
|
ereport(LOG,
|
||||||
|
(errmsg("streaming replication successfully connected to primary")));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.204 2010/02/26 02:01:13 momjian Exp $
|
* $PostgreSQL: pgsql/src/backend/utils/init/postinit.c,v 1.205 2010/03/19 19:19:38 sriggs Exp $
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
@ -217,7 +217,14 @@ PerformAuthentication(Port *port)
|
|||||||
if (!disable_sig_alarm(true))
|
if (!disable_sig_alarm(true))
|
||||||
elog(FATAL, "could not disable timer for authorization timeout");
|
elog(FATAL, "could not disable timer for authorization timeout");
|
||||||
|
|
||||||
if (Log_connections)
|
/*
|
||||||
|
* Log connection for streaming replication even if Log_connections disabled.
|
||||||
|
*/
|
||||||
|
if (am_walsender)
|
||||||
|
ereport(LOG,
|
||||||
|
(errmsg("connection authorized: user=%s database=replication",
|
||||||
|
port->user_name)));
|
||||||
|
else if (Log_connections)
|
||||||
ereport(LOG,
|
ereport(LOG,
|
||||||
(errmsg("connection authorized: user=%s database=%s",
|
(errmsg("connection authorized: user=%s database=%s",
|
||||||
port->user_name, port->database_name)));
|
port->user_name, port->database_name)));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user