Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5494373

Browse files
committed
Refer to max_wal_senders in a more consistent fashion.
The error message now makes explicit reference to the GUC that must be changedto fix the problem, using wording suggested by Tom Lane. Along the way,rename the GUC from MaxWalSenders to max_wal_senders for consistency andgrep-ability.
1 parent38672aa commit5494373

File tree

4 files changed

+16
-14
lines changed

4 files changed

+16
-14
lines changed

‎src/backend/access/transam/xlog.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.385 2010/03/30 16:23:57 heikki Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.386 2010/04/01 00:43:29 rhaas Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -7092,7 +7092,7 @@ CreateCheckPoint(int flags)
70927092
* disconnected (e.g because of network problems), but at least it avoids
70937093
* an open replication connection from failing because of that.
70947094
*/
7095-
if ((_logId||_logSeg)&&MaxWalSenders>0)
7095+
if ((_logId||_logSeg)&&max_wal_senders>0)
70967096
{
70977097
XLogRecPtroldest;
70987098
uint32log;

‎src/backend/replication/walsender.c

Lines changed: 9 additions & 7 deletions
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.13 2010/03/26 12:23:34 heikki Exp $
33+
* $PostgreSQL: pgsql/src/backend/replication/walsender.c,v 1.14 2010/04/01 00:43:29 rhaas Exp $
3434
*
3535
*-------------------------------------------------------------------------
3636
*/
@@ -64,7 +64,7 @@ static WalSnd *MyWalSnd = NULL;
6464
boolam_walsender= false;/* Am I a walsender process ? */
6565

6666
/* User-settable parameters for walsender */
67-
intMaxWalSenders=0;/* the maximum number of concurrent walsenders */
67+
intmax_wal_senders=0;/* the maximum number of concurrent walsenders */
6868
intWalSndDelay=200;/* max sleep time between some actions */
6969

7070
#defineNAPTIME_PER_CYCLE 100000L/* max sleep time between cycles (100ms) */
@@ -452,7 +452,7 @@ InitWalSnd(void)
452452
* Find a free walsender slot and reserve it. If this fails, we must be
453453
* out of WalSnd structures.
454454
*/
455-
for (i=0;i<MaxWalSenders;i++)
455+
for (i=0;i<max_wal_senders;i++)
456456
{
457457
volatileWalSnd*walsnd=&WalSndCtl->walsnds[i];
458458

@@ -476,7 +476,9 @@ InitWalSnd(void)
476476
if (MyWalSnd==NULL)
477477
ereport(FATAL,
478478
(errcode(ERRCODE_TOO_MANY_CONNECTIONS),
479-
errmsg("sorry, too many standbys already")));
479+
errmsg("number of requested standby connections "
480+
"exceeds max_wal_senders (currently %d)",
481+
max_wal_senders)));
480482

481483
/* Arrange to clean up at walsender exit */
482484
on_shmem_exit(WalSndKill,0);
@@ -766,7 +768,7 @@ WalSndShmemSize(void)
766768
Sizesize=0;
767769

768770
size= offsetof(WalSndCtlData,walsnds);
769-
size=add_size(size,mul_size(MaxWalSenders,sizeof(WalSnd)));
771+
size=add_size(size,mul_size(max_wal_senders,sizeof(WalSnd)));
770772

771773
returnsize;
772774
}
@@ -791,7 +793,7 @@ WalSndShmemInit(void)
791793
/* Initialize the data structures */
792794
MemSet(WalSndCtl,0,WalSndShmemSize());
793795

794-
for (i=0;i<MaxWalSenders;i++)
796+
for (i=0;i<max_wal_senders;i++)
795797
{
796798
WalSnd*walsnd=&WalSndCtl->walsnds[i];
797799

@@ -810,7 +812,7 @@ GetOldestWALSendPointer(void)
810812
inti;
811813
boolfound= false;
812814

813-
for (i=0;i<MaxWalSenders;i++)
815+
for (i=0;i<max_wal_senders;i++)
814816
{
815817
/* use volatile pointer to prevent code rearrangement */
816818
volatileWalSnd*walsnd=&WalSndCtl->walsnds[i];

‎src/backend/utils/misc/guc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.545 2010/03/25 14:44:33 alvherre Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.546 2010/04/01 00:43:29 rhaas Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -1705,7 +1705,7 @@ static struct config_int ConfigureNamesInt[] =
17051705
gettext_noop("Sets the maximum number of simultaneously running WAL sender processes."),
17061706
NULL
17071707
},
1708-
&MaxWalSenders,
1708+
&max_wal_senders,
17091709
0,0,INT_MAX /4,NULL,NULL
17101710
},
17111711

‎src/include/access/xlog.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.104 2010/03/19 11:05:15 sriggs Exp $
9+
* $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.105 2010/04/01 00:43:29 rhaas Exp $
1010
*/
1111
#ifndefXLOG_H
1212
#defineXLOG_H
@@ -202,13 +202,13 @@ extern intMaxStandbyDelay;
202202
* This is in walsender.c, but declared here so that we don't need to include
203203
* walsender.h in all files that check XLogIsNeeded()
204204
*/
205-
externintMaxWalSenders;
205+
externintmax_wal_senders;
206206

207207
/*
208208
* Is WAL-logging necessary? We need to log an XLOG record iff either
209209
* WAL archiving is enabled or XLOG streaming is allowed.
210210
*/
211-
#defineXLogIsNeeded() (XLogArchivingActive() || (MaxWalSenders > 0))
211+
#defineXLogIsNeeded() (XLogArchivingActive() || (max_wal_senders > 0))
212212

213213
/* Do we need to WAL-log information required only for Hot Standby? */
214214
#defineXLogStandbyInfoActive() (XLogRequestRecoveryConnections && XLogIsNeeded())

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp