mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-27 08:39:28 +08:00
Make RecordTransactionCommit() respect wal_level.
Since the only purpose of WAL-loggin SharedInvalidationMessages is to support Hot Standby operation, they needn't be included when wal_level < hot_standby. Back-patch to 9.0. Review by Heikki Linnakanagas and Fujii Masao.
This commit is contained in:
parent
e507a3ee7b
commit
361cadb224
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.293.2.3 2010/08/12 23:25:45 rhaas Exp $
|
* $PostgreSQL: pgsql/src/backend/access/transam/xact.c,v 1.293.2.4 2010/08/13 15:45:17 rhaas Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -915,13 +915,14 @@ RecordTransactionCommit(void)
|
|||||||
bool haveNonTemp;
|
bool haveNonTemp;
|
||||||
int nchildren;
|
int nchildren;
|
||||||
TransactionId *children;
|
TransactionId *children;
|
||||||
int nmsgs;
|
int nmsgs = 0;
|
||||||
SharedInvalidationMessage *invalMessages = NULL;
|
SharedInvalidationMessage *invalMessages = NULL;
|
||||||
bool RelcacheInitFileInval;
|
bool RelcacheInitFileInval = false;
|
||||||
|
|
||||||
/* Get data needed for commit record */
|
/* Get data needed for commit record */
|
||||||
nrels = smgrGetPendingDeletes(true, &rels, &haveNonTemp);
|
nrels = smgrGetPendingDeletes(true, &rels, &haveNonTemp);
|
||||||
nchildren = xactGetCommittedChildren(&children);
|
nchildren = xactGetCommittedChildren(&children);
|
||||||
|
if (XLogStandbyInfoActive())
|
||||||
nmsgs = xactGetCommittedInvalidationMessages(&invalMessages,
|
nmsgs = xactGetCommittedInvalidationMessages(&invalMessages,
|
||||||
&RelcacheInitFileInval);
|
&RelcacheInitFileInval);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user