git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e3f3683)
Change a few remaining calls of XLogArchivingActive() to use
2010年1月28日 07:31:42 +0000 (07:31 +0000)
2010年1月28日 07:31:42 +0000 (07:31 +0000)
XLogIsNeeded() instead, to determine if an otherwise non-logged operation
needs to be logged in WAL for standby servers.

Fujii Masao


diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index e1b45325836130f608103f4352bf1e2b82a0dd13..89447d36782c9da6c252bef0f279b21d0b3b1058 100644 (file)
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.318 2010年01月22日 16:40:18 rhaas Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/tablecmds.c,v 1.319 2010年01月28日 07:31:42 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -2998,7 +2998,8 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap)
* Prepare a BulkInsertState and options for heap_insert. Because
* we're building a new heap, we can skip WAL-logging and fsync it
* to disk at the end instead (unless WAL-logging is required for
- * archiving). The FSM is empty too, so don't bother using it.
+ * archiving or streaming replication). The FSM is empty too,
+ * so don't bother using it.
*/
if (newrel)
{
@@ -3006,7 +3007,7 @@ ATRewriteTable(AlteredTableInfo *tab, Oid OIDNewHeap)
bistate = GetBulkInsertState();
hi_options = HEAP_INSERT_SKIP_FSM;
- if (!XLogArchivingActive())
+ if (!XLogIsNeeded())
hi_options |= HEAP_INSERT_SKIP_WAL;
}
else
diff --git a/src/backend/commands/vacuumlazy.c b/src/backend/commands/vacuumlazy.c
index dc80a23fa092cd5b1549cb3aa50ac3f0569ef554..3c7dc2a3d438921597e21f789384358dfbf0cacf 100644 (file)
--- a/src/backend/commands/vacuumlazy.c
+++ b/src/backend/commands/vacuumlazy.c
@@ -29,7 +29,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.127 2010年01月02日 16:57:40 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/vacuumlazy.c,v 1.128 2010年01月28日 07:31:42 heikki Exp $
*
*-------------------------------------------------------------------------
*/
@@ -288,7 +288,7 @@ vacuum_log_cleanup_info(Relation rel, LVRelStats *vacrelstats)
* No need to log changes for temp tables, they do not contain
* data visible on the standby server.
*/
- if (rel->rd_istemp || !XLogArchivingActive())
+ if (rel->rd_istemp || !XLogIsNeeded())
return;
(void) log_heap_cleanup_info(rel->rd_node, vacrelstats->latestRemovedXid);
diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h
index ca4d7f289a7c9bf12755c60fc741aa40130bd51f..d7aeb2fe06bedbdc8b085760cd0631db5a86e608 100644 (file)
--- a/src/include/access/xlog.h
+++ b/src/include/access/xlog.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2010, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.98 2010年01月20日 19:43:40 heikki Exp $
+ * $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.99 2010年01月28日 07:31:42 heikki Exp $
*/
#ifndef XLOG_H
#define XLOG_H
@@ -186,7 +186,6 @@ extern int MaxStandbyDelay;
#define XLogArchivingActive() (XLogArchiveMode)
#define XLogArchiveCommandSet() (XLogArchiveCommand[0] != '0円')
-#define XLogStandbyInfoActive() (XLogRequestRecoveryConnections && XLogArchiveMode)
/*
* This is in walsender.c, but declared here so that we don't need to include
@@ -200,6 +199,9 @@ extern int MaxWalSenders;
*/
#define XLogIsNeeded() (XLogArchivingActive() || (MaxWalSenders > 0))
+/* Do we need to WAL-log information required only for Hot Standby? */
+#define XLogStandbyInfoActive() (XLogRequestRecoveryConnections && XLogIsNeeded())
+
#ifdef WAL_DEBUG
extern bool XLOG_DEBUG;
#endif
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /