mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Throw a nicer error message if a standby server attempts to connect while
the master is still in recovery. We don't support cascading slaves yet. Patch by Fujii Masao, with slightly changed wording.
This commit is contained in:
parent
bd11a0f67f
commit
a383c55a1d
@ -30,7 +30,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.9 2010/02/26 02:00:58 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.10 2010/03/16 09:09:55 heikki Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -119,6 +119,11 @@ WalSenderMain(void)
|
||||
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
|
||||
errmsg("must be superuser to start walsender")));
|
||||
|
||||
if (RecoveryInProgress())
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_CANNOT_CONNECT_NOW),
|
||||
errmsg("recovery is still in progress, can't accept WAL streaming connections")));
|
||||
|
||||
/* Create a per-walsender data structure in shared memory */
|
||||
InitWalSnd();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user