mirror of
https://github.com/postgres/postgres.git
synced 2025-06-30 21:42:05 +03:00
Make CheckRequiredParameterValues() depend upon correct combination
of parameters. Fix bug report by Robert Haas that error message and hint was incorrect if wrong mode parameters specified on master. Internal changes only. Proposals for parameter simplification on master/primary still under way.
This commit is contained in:
@ -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.401 2010/04/20 11:15:06 rhaas Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.402 2010/04/23 19:57:18 sriggs Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -5568,7 +5568,12 @@ CheckRequiredParameterValues(CheckPoint checkPoint)
|
||||
RecoveryRequiresIntParameter("max_locks_per_xact",
|
||||
max_locks_per_xact, checkPoint.max_locks_per_xact);
|
||||
|
||||
if (!checkPoint.XLogStandbyInfoMode)
|
||||
/*
|
||||
* Hot Standby currently only depends upon the presence of WAL
|
||||
* records as indicated by XLOG_MODE_HOT_STANDBY. There is no current
|
||||
* dependency on whether archiving or streaming are enabled, if either.
|
||||
*/
|
||||
if (!(checkPoint.XLogModeFlags & XLOG_MODE_HOT_STANDBY))
|
||||
ereport(ERROR,
|
||||
(errmsg("recovery connections cannot start because the recovery_connections "
|
||||
"parameter is disabled on the WAL source server")));
|
||||
@ -7002,7 +7007,13 @@ CreateCheckPoint(int flags)
|
||||
checkPoint.MaxConnections = MaxConnections;
|
||||
checkPoint.max_prepared_xacts = max_prepared_xacts;
|
||||
checkPoint.max_locks_per_xact = max_locks_per_xact;
|
||||
checkPoint.XLogStandbyInfoMode = XLogStandbyInfoActive();
|
||||
|
||||
if (XLogArchivingActive())
|
||||
checkPoint.XLogModeFlags |= XLOG_MODE_ARCHIVING;
|
||||
if (max_wal_senders > 0)
|
||||
checkPoint.XLogModeFlags |= XLOG_MODE_STREAMING;
|
||||
if (XLogRequestRecoveryConnections)
|
||||
checkPoint.XLogModeFlags |= XLOG_MODE_HOT_STANDBY;
|
||||
|
||||
/*
|
||||
* We must hold WALInsertLock while examining insert state to determine
|
||||
|
Reference in New Issue
Block a user