Skip to content

Commit 491d1ea

Browse files
Previous patch revoked following objections.
1 parent 6ca23b1 commit 491d1ea

File tree

2 files changed

+5
-20
lines changed

2 files changed

+5
-20
lines changed

src/backend/access/transam/xlog.c

Lines changed: 3 additions & 14 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.402 2010/04/23 19:57:18 sriggs Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.403 2010/04/23 20:21:31 sriggs Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -5568,12 +5568,7 @@ CheckRequiredParameterValues(CheckPoint checkPoint)
55685568
RecoveryRequiresIntParameter("max_locks_per_xact",
55695569
max_locks_per_xact, checkPoint.max_locks_per_xact);
55705570

5571-
/*
5572-
* Hot Standby currently only depends upon the presence of WAL
5573-
* records as indicated by XLOG_MODE_HOT_STANDBY. There is no current
5574-
* dependency on whether archiving or streaming are enabled, if either.
5575-
*/
5576-
if (!(checkPoint.XLogModeFlags & XLOG_MODE_HOT_STANDBY))
5571+
if (!checkPoint.XLogStandbyInfoMode)
55775572
ereport(ERROR,
55785573
(errmsg("recovery connections cannot start because the recovery_connections "
55795574
"parameter is disabled on the WAL source server")));
@@ -7007,13 +7002,7 @@ CreateCheckPoint(int flags)
70077002
checkPoint.MaxConnections = MaxConnections;
70087003
checkPoint.max_prepared_xacts = max_prepared_xacts;
70097004
checkPoint.max_locks_per_xact = max_locks_per_xact;
7010-
7011-
if (XLogArchivingActive())
7012-
checkPoint.XLogModeFlags |= XLOG_MODE_ARCHIVING;
7013-
if (max_wal_senders > 0)
7014-
checkPoint.XLogModeFlags |= XLOG_MODE_STREAMING;
7015-
if (XLogRequestRecoveryConnections)
7016-
checkPoint.XLogModeFlags |= XLOG_MODE_HOT_STANDBY;
7005+
checkPoint.XLogStandbyInfoMode = XLogStandbyInfoActive();
70177006

70187007
/*
70197008
* We must hold WALInsertLock while examining insert state to determine

src/include/catalog/pg_control.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
99
* Portions Copyright (c) 1994, Regents of the University of California
1010
*
11-
* $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.52 2010/04/23 19:57:19 sriggs Exp $
11+
* $PostgreSQL: pgsql/src/include/catalog/pg_control.h,v 1.53 2010/04/23 20:21:31 sriggs Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -45,7 +45,7 @@ typedef struct CheckPoint
4545
int MaxConnections;
4646
int max_prepared_xacts;
4747
int max_locks_per_xact;
48-
int XLogModeFlags;
48+
bool XLogStandbyInfoMode;
4949

5050
/*
5151
* Oldest XID still running. This is only needed to initialize hot standby
@@ -65,10 +65,6 @@ typedef struct CheckPoint
6565
#define XLOG_BACKUP_END 0x50
6666
#define XLOG_UNLOGGED 0x60
6767

68-
/* XLogModeFlags */
69-
#define XLOG_MODE_ARCHIVING (1 << 0)
70-
#define XLOG_MODE_STREAMING (1 << 1)
71-
#define XLOG_MODE_HOT_STANDBY (1 << 2)
7268

7369
/* System status indicator */
7470
typedef enum DBState

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy