Skip to content

Commit 296578f

Browse files
Revoke augmentation of WAL records for btree delete, per discussion.
1 parent 9ea9918 commit 296578f

File tree

6 files changed

+14
-48
lines changed

6 files changed

+14
-48
lines changed

doc/src/sgml/config.sgml

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.247 2010/01/29 18:39:05 sriggs Exp $ -->
1+
<!-- $PostgreSQL: pgsql/doc/src/sgml/config.sgml,v 1.248 2010/02/01 13:40:28 sriggs Exp $ -->
22

33
<chapter Id="runtime-config">
44
<title>Server Configuration</title>
@@ -1840,22 +1840,6 @@ archive_command = 'copy "%p" "C:\\server\\archivedir\\%f"' # Windows
18401840
</listitem>
18411841
</varlistentry>
18421842

1843-
<varlistentry id="minimize-standby-conflicts" xreflabel="minimize_standby_conflicts">
1844-
<term><varname>minimize_standby_conflicts</varname> (<type>boolean</type>)</term>
1845-
<indexterm>
1846-
<primary><varname>minimize_standby_conflicts</> configuration parameter</primary>
1847-
</indexterm>
1848-
<listitem>
1849-
<para>
1850-
Generates additional information to the transaction log (WAL) to minimize
1851-
the number of false positive cancelations caused by recovery conflicts on
1852-
a standby server that consumes WAL data from this server.
1853-
There is additional performance cost to enabling this parameter.
1854-
Parameter has no effect during recovery, only in normal running.
1855-
</para>
1856-
</listitem>
1857-
</varlistentry>
1858-
18591843
</variablelist>
18601844
</sect2>
18611845
</sect1>

src/backend/access/nbtree/nbtpage.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
*
1111
* IDENTIFICATION
12-
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.116 2010/01/29 18:39:05 sriggs Exp $
12+
* $PostgreSQL: pgsql/src/backend/access/nbtree/nbtpage.c,v 1.117 2010/02/01 13:40:28 sriggs Exp $
1313
*
1414
* NOTES
1515
* Postgres btree pages look like ordinary relation pages. The opaque
@@ -29,7 +29,6 @@
2929
#include "storage/freespace.h"
3030
#include "storage/indexfsm.h"
3131
#include "storage/lmgr.h"
32-
#include "storage/procarray.h"
3332
#include "utils/inval.h"
3433
#include "utils/snapmgr.h"
3534

@@ -672,18 +671,9 @@ _bt_delitems(Relation rel, Buffer buf,
672671
{
673672
Page page = BufferGetPage(buf);
674673
BTPageOpaque opaque;
675-
TransactionId latestRemovedXid = InvalidTransactionId;
676674

677675
Assert(isVacuum || lastBlockVacuumed == 0);
678676

679-
/*
680-
* If allowed, calculate an accurate latestRemovedXid, otherwise
681-
* pass InvalidTransactionId which can cause false positive
682-
* conflicts to be assessed when we replay this WAL record.
683-
*/
684-
if (!isVacuum && XLogStandbyInfoActive() && MinimizeStandbyConflicts)
685-
latestRemovedXid = GetOldestXmin(false, true);
686-
687677
/* No ereport(ERROR) until changes are logged */
688678
START_CRIT_SECTION();
689679

@@ -731,7 +721,13 @@ _bt_delitems(Relation rel, Buffer buf,
731721
xlrec_delete.node = rel->rd_node;
732722
xlrec_delete.block = BufferGetBlockNumber(buf);
733723

734-
xlrec_delete.latestRemovedXid = latestRemovedXid;
724+
/*
725+
* XXX: We would like to set an accurate latestRemovedXid, but
726+
* there is no easy way of obtaining a useful value. So we punt
727+
* and store InvalidTransactionId, which forces the standby to
728+
* wait for/cancel all currently running transactions.
729+
*/
730+
xlrec_delete.latestRemovedXid = InvalidTransactionId;
735731
rdata[0].data = (char *) &xlrec_delete;
736732
rdata[0].len = SizeOfBtreeDelete;
737733
}

src/backend/access/transam/xlog.c

Lines changed: 1 addition & 2 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.365 2010/01/29 18:39:05 sriggs Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/xlog.c,v 1.366 2010/02/01 13:40:28 sriggs Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -71,7 +71,6 @@ bool XLogArchiveMode = false;
7171
char *XLogArchiveCommand = NULL;
7272
bool XLogRequestRecoveryConnections = true;
7373
int MaxStandbyDelay = 30;
74-
bool MinimizeStandbyConflicts = false;
7574
bool fullPageWrites = true;
7675
bool log_checkpoints = false;
7776
int sync_method = DEFAULT_SYNC_METHOD;

src/backend/utils/misc/guc.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* Written by Peter Eisentraut <peter_e@gmx.net>.
1111
*
1212
* IDENTIFICATION
13-
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.537 2010/01/29 18:39:05 sriggs Exp $
13+
* $PostgreSQL: pgsql/src/backend/utils/misc/guc.c,v 1.538 2010/02/01 13:40:28 sriggs Exp $
1414
*
1515
*--------------------------------------------------------------------
1616
*/
@@ -1222,17 +1222,6 @@ static struct config_bool ConfigureNamesBool[] =
12221222
true, NULL, NULL
12231223
},
12241224

1225-
{
1226-
{"minimize_standby_conflicts", PGC_POSTMASTER, WAL_SETTINGS,
1227-
gettext_noop("Additional information is added to WAL records to"
1228-
" minimize the number of false positive cancelations"
1229-
" caused by recovery conflicts on WAL standby nodes."),
1230-
NULL
1231-
},
1232-
&MinimizeStandbyConflicts,
1233-
false, NULL, NULL
1234-
},
1235-
12361225
{
12371226
{"allow_system_table_mods", PGC_POSTMASTER, DEVELOPER_OPTIONS,
12381227
gettext_noop("Allows modifications of the structure of system tables."),

src/backend/utils/misc/postgresql.conf.sample

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -184,9 +184,8 @@
184184
# - Hot Standby -
185185

186186
#recovery_connections = on # allows connections during recovery
187-
#minimize_standby_conflicts = on # additional WAL info to avoid conflicts
188-
#max_standby_delay = 30 # max acceptable standby lag (s) to help queries
189-
# complete without conflict; -1 disables
187+
#max_standby_delay = 30 # max acceptable standby lag (s) to allow queries
188+
# to complete without conflict; -1 disables
190189

191190
# - Replication -
192191

src/include/access/xlog.h

Lines changed: 1 addition & 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.100 2010/01/29 18:39:05 sriggs Exp $
9+
* $PostgreSQL: pgsql/src/include/access/xlog.h,v 1.101 2010/02/01 13:40:28 sriggs Exp $
1010
*/
1111
#ifndef XLOG_H
1212
#define XLOG_H
@@ -183,7 +183,6 @@ extern int XLogArchiveTimeout;
183183
extern bool log_checkpoints;
184184
extern bool XLogRequestRecoveryConnections;
185185
extern int MaxStandbyDelay;
186-
extern bool MinimizeStandbyConflicts;
187186

188187
#define XLogArchivingActive() (XLogArchiveMode)
189188
#define XLogArchiveCommandSet() (XLogArchiveCommand[0] != '\0')

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