From 296578feb490611f248c2db222f199e5876a3c01 Mon Sep 17 00:00:00 2001 From: Simon Riggs Date: Mon, 1 Feb 2010 13:40:28 +0000 Subject: [PATCH] Revoke augmentation of WAL records for btree delete, per discussion. --- doc/src/sgml/config.sgml | 18 +---------------- src/backend/access/nbtree/nbtpage.c | 20 ++++++++----------- src/backend/access/transam/xlog.c | 3 +-- src/backend/utils/misc/guc.c | 13 +----------- src/backend/utils/misc/postgresql.conf.sample | 5 ++--- src/include/access/xlog.h | 3 +-- 6 files changed, 14 insertions(+), 48 deletions(-) diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml index c8c30c9841..077039e3e1 100644 --- a/doc/src/sgml/config.sgml +++ b/doc/src/sgml/config.sgml @@ -1,4 +1,4 @@ - + Server Configuration @@ -1840,22 +1840,6 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows - - minimize_standby_conflicts (boolean) - - minimize_standby_conflicts configuration parameter - - - - Generates additional information to the transaction log (WAL) to minimize - the number of false positive cancelations caused by recovery conflicts on - a standby server that consumes WAL data from this server. - There is additional performance cost to enabling this parameter. - Parameter has no effect during recovery, only in normal running. - - - - diff --git a/src/backend/access/nbtree/nbtpage.c b/src/backend/access/nbtree/nbtpage.c index 5fa4724602..71b23644e2 100644 --- a/src/backend/access/nbtree/nbtpage.c +++ b/src/backend/access/nbtree/nbtpage.c @@ -9,7 +9,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.116 2010/01/29 18:39:05 sriggs Exp $ + * $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.117 2010/02/01 13:40:28 sriggs Exp $ * * NOTES * Postgres btree pages look like ordinary relation pages. The opaque @@ -29,7 +29,6 @@ #include "storage/freespace.h" #include "storage/indexfsm.h" #include "storage/lmgr.h" -#include "storage/procarray.h" #include "utils/inval.h" #include "utils/snapmgr.h" @@ -672,18 +671,9 @@ _bt_delitems(Relation rel, Buffer buf, { Page page = BufferGetPage(buf); BTPageOpaque opaque; - TransactionId latestRemovedXid = InvalidTransactionId; Assert(isVacuum || lastBlockVacuumed == 0); - /* - * If allowed, calculate an accurate latestRemovedXid, otherwise - * pass InvalidTransactionId which can cause false positive - * conflicts to be assessed when we replay this WAL record. - */ - if (!isVacuum && XLogStandbyInfoActive() && MinimizeStandbyConflicts) - latestRemovedXid = GetOldestXmin(false, true); - /* No ereport(ERROR) until changes are logged */ START_CRIT_SECTION(); @@ -731,7 +721,13 @@ _bt_delitems(Relation rel, Buffer buf, xlrec_delete.node = rel->rd_node; xlrec_delete.block = BufferGetBlockNumber(buf); - xlrec_delete.latestRemovedXid = latestRemovedXid; + /* + * XXX: We would like to set an accurate latestRemovedXid, but + * there is no easy way of obtaining a useful value. So we punt + * and store InvalidTransactionId, which forces the standby to + * wait for/cancel all currently running transactions. + */ + xlrec_delete.latestRemovedXid = InvalidTransactionId; rdata[0].data = (char *) &xlrec_delete; rdata[0].len = SizeOfBtreeDelete; } diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 8aa7976e3e..49adda12f9 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -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.365 2010/01/29 18:39:05 sriggs Exp $ + * $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.366 2010/02/01 13:40:28 sriggs Exp $ * *------------------------------------------------------------------------- */ @@ -71,7 +71,6 @@ bool XLogArchiveMode = false; char *XLogArchiveCommand = NULL; bool XLogRequestRecoveryConnections = true; int MaxStandbyDelay = 30; -bool MinimizeStandbyConflicts = false; bool fullPageWrites = true; bool log_checkpoints = false; int sync_method = DEFAULT_SYNC_METHOD; diff --git a/src/backend/utils/misc/guc.c b/src/backend/utils/misc/guc.c index adf9f72b35..642fc6796a 100644 --- a/src/backend/utils/misc/guc.c +++ b/src/backend/utils/misc/guc.c @@ -10,7 +10,7 @@ * Written by Peter Eisentraut . * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.537 2010/01/29 18:39:05 sriggs Exp $ + * $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.538 2010/02/01 13:40:28 sriggs Exp $ * *-------------------------------------------------------------------- */ @@ -1222,17 +1222,6 @@ static struct config_bool ConfigureNamesBool[] = true, NULL, NULL }, - { - {"minimize_standby_conflicts", PGC_POSTMASTER, WAL_SETTINGS, - gettext_noop("Additional information is added to WAL records to" - " minimize the number of false positive cancelations" - " caused by recovery conflicts on WAL standby nodes."), - NULL - }, - &MinimizeStandbyConflicts, - false, NULL, NULL - }, - { {"allow_system_table_mods", PGC_POSTMASTER, DEVELOPER_OPTIONS, gettext_noop("Allows modifications of the structure of system tables."), diff --git a/src/backend/utils/misc/postgresql.conf.sample b/src/backend/utils/misc/postgresql.conf.sample index 928ccc76ed..c915d19d66 100644 --- a/src/backend/utils/misc/postgresql.conf.sample +++ b/src/backend/utils/misc/postgresql.conf.sample @@ -184,9 +184,8 @@ # - Hot Standby - #recovery_connections = on # allows connections during recovery -#minimize_standby_conflicts = on # additional WAL info to avoid conflicts -#max_standby_delay = 30 # max acceptable standby lag (s) to help queries - # complete without conflict; -1 disables +#max_standby_delay = 30 # max acceptable standby lag (s) to allow queries + # to complete without conflict; -1 disables # - Replication - diff --git a/src/include/access/xlog.h b/src/include/access/xlog.h index 546452f282..daae5077f7 100644 --- 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.100 2010/01/29 18:39:05 sriggs Exp $ + * $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.101 2010/02/01 13:40:28 sriggs Exp $ */ #ifndef XLOG_H #define XLOG_H @@ -183,7 +183,6 @@ extern int XLogArchiveTimeout; extern bool log_checkpoints; extern bool XLogRequestRecoveryConnections; extern int MaxStandbyDelay; -extern bool MinimizeStandbyConflicts; #define XLogArchivingActive() (XLogArchiveMode) #define XLogArchiveCommandSet() (XLogArchiveCommand[0] != '\0') -- 2.40.0