Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a383c55

Browse files
committed
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.
1 parent bd11a0f commit a383c55

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/backend/replication/walsender.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*
3131
*
3232
* IDENTIFICATION
33-
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.9 2010/02/26 02:00:58 momjian Exp $
33+
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.10 2010/03/16 09:09:55 heikki Exp $
3434
*
3535
*-------------------------------------------------------------------------
3636
*/
@@ -119,6 +119,11 @@ WalSenderMain(void)
119119
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
120120
errmsg("must be superuser to start walsender")));
121121

122+
if (RecoveryInProgress())
123+
ereport(FATAL,
124+
(errcode(ERRCODE_CANNOT_CONNECT_NOW),
125+
errmsg("recovery is still in progress, can't accept WAL streaming connections")));
126+
122127
/* Create a per-walsender data structure in shared memory */
123128
InitWalSnd();
124129

0 commit comments

Comments
 (0)