index 94003c0ce29d959f71e95b2c9df30e228a97f72b..dfe2593c9968f34b8af572dca3aa4c14aa1c824b 100644 (file)
* 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 $
*
*-------------------------------------------------------------------------
*/
* 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;
index 21058d10ba799ed5f62b68120b430c502c323618..e04e5ba65caf50019da8442b9c7e7fe89cf1a45b 100644 (file)
*
*
* 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 $
*
*-------------------------------------------------------------------------
*/
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) */
* 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];
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);
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;
}
/* 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];
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];
index ea43b4171b04094ad2e48cf1d669ca7203543d58..5f8cc494893fb918ea4e51616f9d14a633183e83 100644 (file)
* 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 $
*
*--------------------------------------------------------------------
*/
gettext_noop("Sets the maximum number of simultaneously running WAL sender processes."),
NULL
},
- &MaxWalSenders,
+ &max_wal_senders,
0, 0, INT_MAX / 4, NULL, NULL
},
index 9a6cd107614f7fd6d41ba12c23cb67af51ead11d..9a66e9134d4c04057207ecb43285ca93d9a7f970 100644 (file)
* 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
* 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())