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

Commite0e8b96

Browse files
committed
Change a few remaining calls of XLogArchivingActive() to use
XLogIsNeeded() instead, to determine if an otherwise non-logged operationneeds to be logged in WAL for standby servers.Fujii Masao
1 parente3f3683 commite0e8b96

File tree

3 files changed

+10
-7
lines changed

3 files changed

+10
-7
lines changed

‎src/backend/commands/tablecmds.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.318 2010/01/22 16:40:18 rhaas Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.319 2010/01/28 07:31:42 heikki Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -2998,15 +2998,16 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap)
29982998
* Prepare a BulkInsertState and options for heap_insert. Because
29992999
* we're building a new heap, we can skip WAL-logging and fsync it
30003000
* to disk at the end instead (unless WAL-logging is required for
3001-
* archiving). The FSM is empty too, so don't bother using it.
3001+
* archiving or streaming replication). The FSM is empty too,
3002+
* so don't bother using it.
30023003
*/
30033004
if (newrel)
30043005
{
30053006
mycid=GetCurrentCommandId(true);
30063007
bistate=GetBulkInsertState();
30073008

30083009
hi_options=HEAP_INSERT_SKIP_FSM;
3009-
if (!XLogArchivingActive())
3010+
if (!XLogIsNeeded())
30103011
hi_options |=HEAP_INSERT_SKIP_WAL;
30113012
}
30123013
else

‎src/backend/commands/vacuumlazy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
*
3030
*
3131
* IDENTIFICATION
32-
* $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.127 2010/01/02 16:57:40 momjian Exp $
32+
* $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.128 2010/01/28 07:31:42 heikki Exp $
3333
*
3434
*-------------------------------------------------------------------------
3535
*/
@@ -288,7 +288,7 @@ vacuum_log_cleanup_info(Relation rel, LVRelStats *vacrelstats)
288288
* No need to log changes for temp tables, they do not contain
289289
* data visible on the standby server.
290290
*/
291-
if (rel->rd_istemp|| !XLogArchivingActive())
291+
if (rel->rd_istemp|| !XLogIsNeeded())
292292
return;
293293

294294
(void)log_heap_cleanup_info(rel->rd_node,vacrelstats->latestRemovedXid);

‎src/include/access/xlog.h

Lines changed: 4 additions & 2 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.98 2010/01/20 19:43:40 heikki Exp $
9+
* $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.99 2010/01/28 07:31:42 heikki Exp $
1010
*/
1111
#ifndefXLOG_H
1212
#defineXLOG_H
@@ -186,7 +186,6 @@ extern int MaxStandbyDelay;
186186

187187
#defineXLogArchivingActive()(XLogArchiveMode)
188188
#defineXLogArchiveCommandSet() (XLogArchiveCommand[0] != '\0')
189-
#defineXLogStandbyInfoActive()(XLogRequestRecoveryConnections && XLogArchiveMode)
190189

191190
/*
192191
* This is in walsender.c, but declared here so that we don't need to include
@@ -200,6 +199,9 @@ extern intMaxWalSenders;
200199
*/
201200
#defineXLogIsNeeded() (XLogArchivingActive() || (MaxWalSenders > 0))
202201

202+
/* Do we need to WAL-log information required only for Hot Standby? */
203+
#defineXLogStandbyInfoActive()(XLogRequestRecoveryConnections && XLogIsNeeded())
204+
203205
#ifdefWAL_DEBUG
204206
externboolXLOG_DEBUG;
205207
#endif

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp