mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-21 08:29:39 +08:00
Refer to max_wal_senders in a more consistent fashion.
The error message now makes explicit reference to the GUC that must be changed to fix the problem, using wording suggested by Tom Lane. Along the way, rename the GUC from MaxWalSenders to max_wal_senders for consistency and grep-ability.
This commit is contained in:
parent
38672aaaa1
commit
54943734f8
@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.385 2010/03/30 16:23:57 heikki Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.386 2010/04/01 00:43:29 rhaas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -7092,7 +7092,7 @@ CreateCheckPoint(int flags)
|
||||
* disconnected (e.g because of network problems), but at least it avoids
|
||||
* an open replication connection from failing because of that.
|
||||
*/
|
||||
if ((_logId || _logSeg) && MaxWalSenders > 0)
|
||||
if ((_logId || _logSeg) && max_wal_senders > 0)
|
||||
{
|
||||
XLogRecPtr oldest;
|
||||
uint32 log;
|
||||
|
@ -30,7 +30,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.13 2010/03/26 12:23:34 heikki Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.14 2010/04/01 00:43:29 rhaas Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -64,7 +64,7 @@ static WalSnd *MyWalSnd = NULL;
|
||||
bool am_walsender = false; /* Am I a walsender process ? */
|
||||
|
||||
/* User-settable parameters for walsender */
|
||||
int MaxWalSenders = 0; /* the maximum number of concurrent walsenders */
|
||||
int max_wal_senders = 0; /* the maximum number of concurrent walsenders */
|
||||
int WalSndDelay = 200; /* max sleep time between some actions */
|
||||
|
||||
#define NAPTIME_PER_CYCLE 100000L /* max sleep time between cycles (100ms) */
|
||||
@ -452,7 +452,7 @@ InitWalSnd(void)
|
||||
* Find a free walsender slot and reserve it. If this fails, we must be
|
||||
* out of WalSnd structures.
|
||||
*/
|
||||
for (i = 0; i < MaxWalSenders; i++)
|
||||
for (i = 0; i < max_wal_senders; i++)
|
||||
{
|
||||
volatile WalSnd *walsnd = &WalSndCtl->walsnds[i];
|
||||
|
||||
@ -476,7 +476,9 @@ InitWalSnd(void)
|
||||
if (MyWalSnd == NULL)
|
||||
ereport(FATAL,
|
||||
(errcode(ERRCODE_TOO_MANY_CONNECTIONS),
|
||||
errmsg("sorry, too many standbys already")));
|
||||
errmsg("number of requested standby connections "
|
||||
"exceeds max_wal_senders (currently %d)",
|
||||
max_wal_senders)));
|
||||
|
||||
/* Arrange to clean up at walsender exit */
|
||||
on_shmem_exit(WalSndKill, 0);
|
||||
@ -766,7 +768,7 @@ WalSndShmemSize(void)
|
||||
Size size = 0;
|
||||
|
||||
size = offsetof(WalSndCtlData, walsnds);
|
||||
size = add_size(size, mul_size(MaxWalSenders, sizeof(WalSnd)));
|
||||
size = add_size(size, mul_size(max_wal_senders, sizeof(WalSnd)));
|
||||
|
||||
return size;
|
||||
}
|
||||
@ -791,7 +793,7 @@ WalSndShmemInit(void)
|
||||
/* Initialize the data structures */
|
||||
MemSet(WalSndCtl, 0, WalSndShmemSize());
|
||||
|
||||
for (i = 0; i < MaxWalSenders; i++)
|
||||
for (i = 0; i < max_wal_senders; i++)
|
||||
{
|
||||
WalSnd *walsnd = &WalSndCtl->walsnds[i];
|
||||
|
||||
@ -810,7 +812,7 @@ GetOldestWALSendPointer(void)
|
||||
int i;
|
||||
bool found = false;
|
||||
|
||||
for (i = 0; i < MaxWalSenders; i++)
|
||||
for (i = 0; i < max_wal_senders; i++)
|
||||
{
|
||||
/* use volatile pointer to prevent code rearrangement */
|
||||
volatile WalSnd *walsnd = &WalSndCtl->walsnds[i];
|
||||
|
@ -10,7 +10,7 @@
|
||||
* Written by Peter Eisentraut <peter_e@gmx.net>.
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.545 2010/03/25 14:44:33 alvherre Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.546 2010/04/01 00:43:29 rhaas Exp $
|
||||
*
|
||||
*--------------------------------------------------------------------
|
||||
*/
|
||||
@ -1705,7 +1705,7 @@ static struct config_int ConfigureNamesInt[] =
|
||||
gettext_noop("Sets the maximum number of simultaneously running WAL sender processes."),
|
||||
NULL
|
||||
},
|
||||
&MaxWalSenders,
|
||||
&max_wal_senders,
|
||||
0, 0, INT_MAX / 4, NULL, NULL
|
||||
},
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.104 2010/03/19 11:05:15 sriggs Exp $
|
||||
* $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.105 2010/04/01 00:43:29 rhaas Exp $
|
||||
*/
|
||||
#ifndef XLOG_H
|
||||
#define XLOG_H
|
||||
@ -202,13 +202,13 @@ extern int MaxStandbyDelay;
|
||||
* This is in walsender.c, but declared here so that we don't need to include
|
||||
* walsender.h in all files that check XLogIsNeeded()
|
||||
*/
|
||||
extern int MaxWalSenders;
|
||||
extern int max_wal_senders;
|
||||
|
||||
/*
|
||||
* Is WAL-logging necessary? We need to log an XLOG record iff either
|
||||
* WAL archiving is enabled or XLOG streaming is allowed.
|
||||
*/
|
||||
#define XLogIsNeeded() (XLogArchivingActive() || (MaxWalSenders > 0))
|
||||
#define XLogIsNeeded() (XLogArchivingActive() || (max_wal_senders > 0))
|
||||
|
||||
/* Do we need to WAL-log information required only for Hot Standby? */
|
||||
#define XLogStandbyInfoActive() (XLogRequestRecoveryConnections && XLogIsNeeded())
|
||||
|
Loading…
Reference in New Issue
Block a user